vertex_adjacency_matrix#

iskra.topology.vertex_adjacency_matrix(n_vertices: int, faces: Tensor) SparseTensor[SOURCE]#

Undirected vertex-vertex adjacency matrix.

Tip

The faces argument can be an arbitrary simplex. Tets, triangles, and edges all work.

Parameters:
  • n_vertices (int) – Number of vertices in your mesh.

  • faces (Tensor) – Tensor representing the mesh topology with shape [n_faces, n_face_corners], where n_faces is the number of faces and n_face_corners is the number of simplex corners,.

Returns:

(SparseTensor[Float, []]) – A sparse COO tensor of shape [n_vertices, n_vertices]. An entry is 1 if two vertices share an edge.