is_sparse.h 659 B

1234567891011121314151617181920212223242526272829
  1. #ifndef IGL_IS_SPARSE_H
  2. #define IGL_IS_SPARSE_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. namespace igl
  8. {
  9. // Determine if a matrix A is sparse
  10. //
  11. // Template:
  12. // T,DerivedA defines scalar type
  13. // Inputs:
  14. // A matrix in question
  15. // Returns true if A is represented with a sparse matrix
  16. template <typename T>
  17. IGL_INLINE bool is_sparse(
  18. const Eigen::SparseMatrix<T> & A);
  19. template <typename DerivedA>
  20. IGL_INLINE bool is_sparse(
  21. const Eigen::PlainObjectBase<DerivedA>& A);
  22. }
  23. #ifdef IGL_HEADER_ONLY
  24. # include "is_sparse.cpp"
  25. #endif
  26. #endif