Эх сурвалжийг харах

fixed bug in updating the weights

Former-commit-id: 8762e9f5c591f094c9859aff7247b070a5c44a04
Daniele Panozzo 7 жил өмнө
parent
commit
7ed22b9122

+ 2 - 2
include/igl/slim.cpp

@@ -578,9 +578,9 @@ namespace igl
       L = s.AtA + s.proximal_p * id_m; //add also a proximal 
       L.makeCompressed();
 
-      Eigen::SparseMatrix<double> L2 = At * s.WGL_M.asDiagonal() * s.A + s.proximal_p * id_m; 
+      // Eigen::SparseMatrix<double> L2 = At * s.WGL_M.asDiagonal() * s.A + s.proximal_p * id_m; 
       
-      std::cerr << "Error: ------> " << (L2 - L).norm() << std::endl;
+      // std::cerr << "Error: ------> " << (L2 - L).norm() << std::endl;
 
       #else
       L = At * s.WGL_M.asDiagonal() * A + s.proximal_p * id_m; //add also a proximal term

+ 2 - 2
include/igl/sparse_AtA_fast.cpp

@@ -93,7 +93,7 @@ IGL_INLINE void igl::sparse_AtA_fast_precompute(
           {
             data.I_row.push_back(Col_IndexPtr[row][i]);
             data.I_col.push_back(Col_IndexPtr[col][j]);
-            data.I_w.push_back(data.W[Col_RowPtr[col][j]]);
+            data.I_w.push_back(Col_RowPtr[col][j]);
             ++i;
             ++j;
           } else 
@@ -119,7 +119,7 @@ IGL_INLINE void igl::sparse_AtA_fast(
   {
     *(AtA.valuePtr() + i) = 0;
     for (unsigned j=data.I_outer[i]; j<data.I_outer[i+1]; ++j)
-      *(AtA.valuePtr() + i) += *(A.valuePtr() + data.I_row[j]) * data.I_w[j] * *(A.valuePtr() + data.I_col[j]);
+      *(AtA.valuePtr() + i) += *(A.valuePtr() + data.I_row[j]) * data.W[data.I_w[j]] * *(A.valuePtr() + data.I_col[j]);
   }
 }
 

+ 1 - 1
include/igl/sparse_AtA_fast.h

@@ -21,7 +21,7 @@ namespace igl
     // Flatten composition rules
     std::vector<int> I_row;
     std::vector<int> I_col;
-    std::vector<double> I_w;
+    std::vector<int> I_w;
 
     // For each entry of AtA, points to the beginning
     // of the composition rules