#ifndef IGL_FULL_H #define IGL_FULL_H #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET #include #include namespace igl { // Convert a sparsematrix into a full one // Templates: // T should be a eigen sparse matrix primitive type like int or double // Input: // A m by n sparse matrix // Output: // B m by n dense/full matrix template inline void full( const Eigen::SparseMatrix & A, Eigen::Matrix & B); } // Implementation template inline void igl::full( const Eigen::SparseMatrix & A, Eigen::Matrix & B) { B = Eigen::Matrix::Zero(A.rows(),A.cols()); // Iterate over outside for(int k=0; k::InnerIterator it (A,k); it; ++it) { B(it.row(),it.col()) = it.value(); } } } #endif