is_symmetric.h 590 B

1234567891011121314151617181920212223
  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 T>
  13. IGL_INLINE bool is_symmetric(const Eigen::SparseMatrix<T>& A);
  14. template <typename DerivedA>
  15. IGL_INLINE bool is_symmetric(
  16. const Eigen::PlainObjectBase<DerivedA>& A);
  17. }
  18. #ifdef IGL_HEADER_ONLY
  19. # include "is_symmetric.cpp"
  20. #endif
  21. #endif