浏览代码

possible bug fix in slice, minor other changes

Former-commit-id: c0e415a86134e5459fbdb661c21ac09b68347070
jalec 13 年之前
父节点
当前提交
5f4ec9681d
共有 3 个文件被更改,包括 22 次插入6 次删除
  1. 1 1
      min_quad_with_fixed.h
  2. 1 1
      report_gl_error.h
  3. 20 4
      slice.h

+ 1 - 1
min_quad_with_fixed.h

@@ -33,7 +33,7 @@ namespace igl
   template <typename T>
   inline bool min_quad_with_fixed_precompute(
     const Eigen::SparseMatrix<T>& A,
-    const Eigen::MatrixXi & known,
+    const Eigen::Matrix<int,Eigen::Dynamic,1> & known,
     const Eigen::SparseMatrix<T>& Aeq,
     const bool pd,
     min_quad_with_fixed_data<T> & data

+ 1 - 1
report_gl_error.h

@@ -18,7 +18,7 @@ namespace igl
   // Inputs:
   //   id   string to appear before any error msgs
   // Returns result of glGetError() 
-  inline GLenum report_gl_error(const std::string id = string(""));
+  inline GLenum report_gl_error(const std::string id = std::string(""));
 }
 
 // Implementation

+ 20 - 4
slice.h

@@ -51,14 +51,22 @@ inline void igl::slice(
   // Build reindexing maps for columns and rows, -1 means not in map
   Eigen::Matrix<int,Eigen::Dynamic,1> RI;
   RI.resize(xm);
-  RI.array() = RI.array()*0-1;
+  // initialize to -1
+  for(int i = 0;i<xm;i++)
+  {
+    RI(i) = -1;
+  }
   for(int i = 0;i<ym;i++)
   {
     RI(R(i)) = i;
   }
   Eigen::Matrix<int,Eigen::Dynamic,1> CI;
   CI.resize(xn);
-  CI.array() = CI.array()*0-1;
+  // initialize to -1
+  for(int i = 0;i<xn;i++)
+  {
+    CI(i) = -1;
+  }
   for(int i = 0;i<yn;i++)
   {
     CI(C(i)) = i;
@@ -99,14 +107,22 @@ inline void igl::slice(
   // Build reindexing maps for columns and rows, -1 means not in map
   Eigen::Matrix<int,Eigen::Dynamic,1> RI;
   RI.resize(xm);
-  RI.array() = RI.array()*0-1;
+  // initialize to -1
+  for(int i = 0;i<xm;i++)
+  {
+    RI(i) = -1;
+  }
   for(int i = 0;i<ym;i++)
   {
     RI(R(i)) = i;
   }
   Eigen::Matrix<int,Eigen::Dynamic,1> CI;
   CI.resize(xn);
-  CI.array() = CI.array()*0-1;
+  // initialize to -1
+  for(int i = 0;i<xn;i++)
+  {
+    CI(i) = -1;
+  }
   for(int i = 0;i<yn;i++)
   {
     CI(C(i)) = i;