diff --git a/vcg/complex/algorithms/harmonic.h b/vcg/complex/algorithms/harmonic.h index f38cac0b..ea3c1d47 100644 --- a/vcg/complex/algorithms/harmonic.h +++ b/vcg/complex/algorithms/harmonic.h @@ -41,20 +41,21 @@ public: { typedef Eigen::SparseMatrix SpMat; // sparse matrix type typedef Eigen::Triplet Triple; // triplet type to fill the matrix - std::vector remap; - RequirePerVertexFlags(m); RequireCompactness(m); RequireFFAdjacency(m); + if (constraints.empty()) + return false; + int n = m.VN(); // Generate coefficients std::vector coeffs; // coefficients of the system std::map sums; // row sum of the coefficient matrix - vcg::tri::UpdateFlags::FaceClearV(m); + vcg::tri::UpdateFlags::FaceClearV(m); for (size_t i = 0; i < m.face.size(); ++i) { FaceType & f = m.face[i]; @@ -110,7 +111,7 @@ public: } // Perform matrix decomposition - Eigen::SimplicialLDLT > solver; + Eigen::SimplicialLDLT solver; solver.compute(laplaceMat); // TODO eventually use another solver (e.g. CHOLMOD for dynamic setups) if(solver.info() != Eigen::Success)