#include "is_symmetric.h" template IGL_INLINE bool igl::is_symmetric(const Eigen::SparseMatrix& A) { if(A.rows() != A.cols()) { return false; } Eigen::SparseMatrix AT = A.transpose(); Eigen::SparseMatrix AmAT = A-AT; //// Eigen screws up something with LLT if you try to do //SparseMatrix AmAT = A-A.transpose(); //// Eigen crashes at runtime if you try to do // return (A-A.transpose()).nonZeros() == 0; return AmAT.nonZeros() == 0; } #ifndef IGL_HEADER_ONLY // Explicit template specialization #endif