From d336746cd13435e86ead89cb1e34e6c001f600d2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 4 Sep 2018 18:06:57 +0200 Subject: [PATCH] bug fix --- .../include/CGAL/Heat_method_3/Heat_method_3.h | 3 +++ Solver_interface/include/CGAL/Eigen_matrix.h | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Heat_method_3/include/CGAL/Heat_method_3/Heat_method_3.h b/Heat_method_3/include/CGAL/Heat_method_3/Heat_method_3.h index ff7b8c1e287..a597e039276 100644 --- a/Heat_method_3/include/CGAL/Heat_method_3/Heat_method_3.h +++ b/Heat_method_3/include/CGAL/Heat_method_3/Heat_method_3.h @@ -514,6 +514,9 @@ namespace Heat_method_3 { } int m = static_cast(num_vertices(tm)); dimension = m; + + m_mass_matrix.eigen_object().resize(m,m); + m_cotan_matrix.eigen_object().resize(m,m); CGAL::Vertex_around_face_iterator vbegin, vend, vmiddle; //Go through each face on the mesh { diff --git a/Solver_interface/include/CGAL/Eigen_matrix.h b/Solver_interface/include/CGAL/Eigen_matrix.h index 8d4a937c6e8..9a244422656 100644 --- a/Solver_interface/include/CGAL/Eigen_matrix.h +++ b/Solver_interface/include/CGAL/Eigen_matrix.h @@ -264,6 +264,19 @@ public: 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: /// Eigen_sparse_matrix cannot be copied (yet) Eigen_sparse_matrix(const Eigen_sparse_matrix& rhs);