This commit is contained in:
Andreas Fabri 2018-09-04 18:06:57 +02:00
parent 4e6293d940
commit d336746cd1
2 changed files with 16 additions and 0 deletions

View File

@ -514,6 +514,9 @@ namespace Heat_method_3 {
} }
int m = static_cast<int>(num_vertices(tm)); int m = static_cast<int>(num_vertices(tm));
dimension = m; dimension = m;
m_mass_matrix.eigen_object().resize(m,m);
m_cotan_matrix.eigen_object().resize(m,m);
CGAL::Vertex_around_face_iterator<TriangleMesh> vbegin, vend, vmiddle; CGAL::Vertex_around_face_iterator<TriangleMesh> vbegin, vend, vmiddle;
//Go through each face on the mesh //Go through each face on the mesh
{ {

View File

@ -264,6 +264,19 @@ public:
return m_matrix; return m_matrix;
} }
/// Return the internal matrix, with type `EigenType`.
EigenType& eigen_object()
{
if(!m_is_already_built)
assemble_matrix();
// turns the matrix into compressed mode:
// -> release some memory
// -> required for some external solvers
m_matrix.makeCompressed();
return m_matrix;
}
private: private:
/// Eigen_sparse_matrix cannot be copied (yet) /// Eigen_sparse_matrix cannot be copied (yet)
Eigen_sparse_matrix(const Eigen_sparse_matrix& rhs); Eigen_sparse_matrix(const Eigen_sparse_matrix& rhs);