Browse Source

Merge pull request #466 from gaoxifeng/master

fixed an initialization bug in func "solve_weighted_arap" of slim.cpp

Former-commit-id: 71cea6e571eb49ba780702c2aa44da2192d225ee
Daniele Panozzo 8 years ago
parent
commit
a549b5b0aa
1 changed files with 1 additions and 1 deletions
  1. 1 1
      include/igl/slim.cpp

+ 1 - 1
include/igl/slim.cpp

@@ -405,7 +405,7 @@ namespace igl
       else
       { // seems like CG performs much worse for 2D and way better for 3D
         Eigen::VectorXd guess(uv.rows() * s.dim);
-        for (int i = 0; i < s.dim; i++) for (int j = 0; j < s.dim; j++) guess(uv.rows() * i + j) = uv(i, j); // flatten vector
+        for (int i = 0; i < s.v_num; i++) for (int j = 0; j < s.dim; j++) guess(uv.rows() * j + i) = uv(i, j); // flatten vector
         ConjugateGradient<Eigen::SparseMatrix<double>, Eigen::Lower | Upper> solver;
         solver.setTolerance(1e-8);
         Uc = solver.compute(L).solveWithGuess(s.rhs, guess);