소스 검색

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>
   template <typename T>
   inline bool min_quad_with_fixed_precompute(
   inline bool min_quad_with_fixed_precompute(
     const Eigen::SparseMatrix<T>& A,
     const Eigen::SparseMatrix<T>& A,
-    const Eigen::MatrixXi & known,
+    const Eigen::Matrix<int,Eigen::Dynamic,1> & known,
     const Eigen::SparseMatrix<T>& Aeq,
     const Eigen::SparseMatrix<T>& Aeq,
     const bool pd,
     const bool pd,
     min_quad_with_fixed_data<T> & data
     min_quad_with_fixed_data<T> & data

+ 1 - 1
report_gl_error.h

@@ -18,7 +18,7 @@ namespace igl
   // Inputs:
   // Inputs:
   //   id   string to appear before any error msgs
   //   id   string to appear before any error msgs
   // Returns result of glGetError() 
   // 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
 // 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
   // Build reindexing maps for columns and rows, -1 means not in map
   Eigen::Matrix<int,Eigen::Dynamic,1> RI;
   Eigen::Matrix<int,Eigen::Dynamic,1> RI;
   RI.resize(xm);
   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++)
   for(int i = 0;i<ym;i++)
   {
   {
     RI(R(i)) = i;
     RI(R(i)) = i;
   }
   }
   Eigen::Matrix<int,Eigen::Dynamic,1> CI;
   Eigen::Matrix<int,Eigen::Dynamic,1> CI;
   CI.resize(xn);
   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++)
   for(int i = 0;i<yn;i++)
   {
   {
     CI(C(i)) = 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
   // Build reindexing maps for columns and rows, -1 means not in map
   Eigen::Matrix<int,Eigen::Dynamic,1> RI;
   Eigen::Matrix<int,Eigen::Dynamic,1> RI;
   RI.resize(xm);
   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++)
   for(int i = 0;i<ym;i++)
   {
   {
     RI(R(i)) = i;
     RI(R(i)) = i;
   }
   }
   Eigen::Matrix<int,Eigen::Dynamic,1> CI;
   Eigen::Matrix<int,Eigen::Dynamic,1> CI;
   CI.resize(xn);
   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++)
   for(int i = 0;i<yn;i++)
   {
   {
     CI(C(i)) = i;
     CI(C(i)) = i;