adjacency_list.h 1006 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef IGL_ADJACENCY_LIST_H
  2. #define IGL_ADJACENCY_LIST_H
  3. #include "igl_inline.h"
  4. #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
  5. #include <Eigen/Dense>
  6. #include <Eigen/Sparse>
  7. #include <vector>
  8. namespace igl
  9. {
  10. // Constructs the graph adjacency list of a given mesh (V,F)
  11. // Templates:
  12. // T should be a eigen sparse matrix primitive type like int or double
  13. // Inputs:
  14. // F #F by dim list of mesh faces (must be triangles)
  15. // sorted flag that indicates if the list should be sorted counter-clockwise
  16. // Outputs:
  17. // A vector<vector<T> > containing at row i the adjacent vertices of vertex i
  18. //
  19. // Example:
  20. // // Mesh in (V,F)
  21. // vector<vector<double> > A;
  22. // adjacency_list(F,A);
  23. //
  24. // See also: edges, cotmatrix, diag
  25. template <typename T, typename M>
  26. IGL_INLINE void adjacency_list(
  27. const M & F,
  28. std::vector<std::vector<T> >& A,
  29. bool sorted = false);
  30. }
  31. #ifdef IGL_HEADER_ONLY
  32. # include "adjacency_list.cpp"
  33. #endif
  34. #endif