is_symmetric.h 798 B

123456789101112131415161718192021222324252627
  1. #ifndef IGL_IS_SYMMETRIC_H
  2. #define IGL_IS_SYMMETRIC_H
  3. #include "igl_inline.h"
  4. #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
  5. #include <Eigen/Sparse>
  6. namespace igl
  7. {
  8. // Returns true if the given matrix is symmetric
  9. // Inputs:
  10. // A m by m matrix
  11. // Returns true if the matrix is square and symmetric
  12. template <typename AT>
  13. IGL_INLINE bool is_symmetric(const Eigen::SparseMatrix<AT>& A);
  14. // Inputs:
  15. // epsilon threshold on L1 difference between A and A'
  16. template <typename AT, typename epsilonT>
  17. IGL_INLINE bool is_symmetric(const Eigen::SparseMatrix<AT>& A, const epsilonT epsilon);
  18. template <typename DerivedA>
  19. IGL_INLINE bool is_symmetric(
  20. const Eigen::PlainObjectBase<DerivedA>& A);
  21. }
  22. #ifdef IGL_HEADER_ONLY
  23. # include "is_symmetric.cpp"
  24. #endif
  25. #endif