Browse Source

tempoarary fix in slice, still requires some debugging

Former-commit-id: 62ef9cc3655d78b8c655487c1c832792f72c4b3d
Daniele Panozzo 9 years ago
parent
commit
713685dbd4
4 changed files with 29 additions and 25 deletions
  1. 1 0
      .gitignore
  2. 0 2
      python/301_Slice.py
  3. 1 1
      python/302_Sort.py
  4. 27 22
      python/py_igl/py_slice.cpp

+ 1 - 0
.gitignore

@@ -84,3 +84,4 @@ python/.ipynb_checkpoints
 python/py_igl/todo
 python/__pycache__
 iglhelpers.pyc
+python/build2

+ 0 - 2
python/301_Slice.py

@@ -23,8 +23,6 @@ igl.floor((0.5*(temp+1.)*I.rows()),J)
 K = igl.eigen.MatrixXi()
 igl.slice(I,J,K)
 
-exit(0)
-
 # default green for all faces
 #C = p2e(np.array([[0.4,0.8,0.3]])).replicate(F.rows(),1)
 C = igl.eigen.MatrixXd([[0.4,0.8,0.3]]).replicate(F.rows(),1)

+ 1 - 1
python/302_Sort.py

@@ -21,7 +21,7 @@ igl.sortrows(BC,True,sorted_BC,I)
 J.resize(I.rows(),1)
 # J(I) = 1:numel(I)
 
-igl.slice_into(igl.coloni(0,I.size())-1,I,J)
+igl.slice_into(igl.coloni(0,I.size()-1),I,J)
 
 # Pseudo-color based on sorted place
 C = igl.eigen.MatrixXd()

+ 27 - 22
python/py_igl/py_slice.cpp

@@ -1,5 +1,5 @@
-// Double
-
+// // Double
+//
 m.def("slice", []
 (
   const Eigen::SparseMatrix<double>& X,
@@ -53,16 +53,19 @@ m.def("slice", []
 }, __doc_igl_slice,
 py::arg("X"), py::arg("R"), py::arg("Y"));
 
-m.def("slice", []
-(
-  const Eigen::MatrixXd& X,
-  const Eigen::MatrixXi& R
-)
-{
-  assert_is_VectorX("R",R);
-  return igl::slice(X,R);
-}, __doc_igl_slice,
-py::arg("X"), py::arg("R"));
+// // TODO: problematic!
+// m.def("slice", []
+// (
+//   const Eigen::MatrixXd& X,
+//   const Eigen::MatrixXi& R
+// )
+// {
+//   std::cerr << "Maybe also here?" << std::endl;
+//   // assert_is_VectorX("R",R);
+//   // return igl::slice(X,R);
+//   return;
+// }, __doc_igl_slice,
+// py::arg("X"), py::arg("R"));
 
 m.def("slice", []
 (
@@ -118,6 +121,7 @@ m.def("slice", []
 }, __doc_igl_slice,
 py::arg("X"), py::arg("R"), py::arg("C"), py::arg("Y"));
 
+
 m.def("slice", []
 (
   const Eigen::MatrixXi& X,
@@ -130,16 +134,17 @@ m.def("slice", []
 }, __doc_igl_slice,
 py::arg("X"), py::arg("R"), py::arg("Y"));
 
-m.def("slice", []
-(
-  const Eigen::MatrixXi& X,
-  const Eigen::MatrixXi& R
-)
-{
-  assert_is_VectorX("R",R);
-  return igl::slice(X,R);
-}, __doc_igl_slice,
-py::arg("X"), py::arg("R"));
+// TODO: Problematic
+// m.def("slice", []
+// (
+//   const Eigen::MatrixXi& X,
+//   const Eigen::MatrixXi& R
+// )
+// {
+//   assert_is_VectorX("R",R);
+//   return igl::slice(X,R);
+// }, __doc_igl_slice,
+// py::arg("X"), py::arg("R"));
 
 m.def("slice", []
 (