浏览代码

better templating

Former-commit-id: 9d3040936fc337a55e9323c2c61a63d692cf4bb8
Alec Jacobson 8 年之前
父节点
当前提交
1119772c3c
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 3 3
      include/igl/find.cpp
  2. 2 2
      include/igl/find.h

+ 3 - 3
include/igl/find.cpp

@@ -47,7 +47,7 @@ template <
   typename DerivedJ,
   typename DerivedJ,
   typename DerivedV>
   typename DerivedV>
 IGL_INLINE void igl::find(
 IGL_INLINE void igl::find(
-  const Eigen::PlainObjectBase<DerivedX>& X,
+  const Eigen::DenseBase<DerivedX>& X,
   Eigen::PlainObjectBase<DerivedI> & I,
   Eigen::PlainObjectBase<DerivedI> & I,
   Eigen::PlainObjectBase<DerivedJ> & J,
   Eigen::PlainObjectBase<DerivedJ> & J,
   Eigen::PlainObjectBase<DerivedV> & V)
   Eigen::PlainObjectBase<DerivedV> & V)
@@ -78,7 +78,7 @@ template <
   typename DerivedX,
   typename DerivedX,
   typename DerivedI>
   typename DerivedI>
 IGL_INLINE void igl::find(
 IGL_INLINE void igl::find(
-  const Eigen::PlainObjectBase<DerivedX>& X,
+  const Eigen::DenseBase<DerivedX>& X,
   Eigen::PlainObjectBase<DerivedI> & I)
   Eigen::PlainObjectBase<DerivedI> & I)
 {
 {
   const int nnz = X.count();
   const int nnz = X.count();
@@ -126,6 +126,6 @@ template void igl::find<double, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matr
 template void igl::find<double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 template void igl::find<double, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 // generated by autoexplicit.sh
 // generated by autoexplicit.sh
 template void igl::find<double, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
 template void igl::find<double, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
-template void igl::find<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::find<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::DenseBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 template void igl::find<double, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::MatrixBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 template void igl::find<double, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::MatrixBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
 #endif
 #endif

+ 2 - 2
include/igl/find.h

@@ -41,7 +41,7 @@ namespace igl
     typename DerivedJ,
     typename DerivedJ,
     typename DerivedV>
     typename DerivedV>
   IGL_INLINE void find(
   IGL_INLINE void find(
-    const Eigen::PlainObjectBase<DerivedX>& X,
+    const Eigen::DenseBase<DerivedX>& X,
     Eigen::PlainObjectBase<DerivedI> & I,
     Eigen::PlainObjectBase<DerivedI> & I,
     Eigen::PlainObjectBase<DerivedJ> & J,
     Eigen::PlainObjectBase<DerivedJ> & J,
     Eigen::PlainObjectBase<DerivedV> & V);
     Eigen::PlainObjectBase<DerivedV> & V);
@@ -49,7 +49,7 @@ namespace igl
     typename DerivedX,
     typename DerivedX,
     typename DerivedI>
     typename DerivedI>
   IGL_INLINE void find(
   IGL_INLINE void find(
-    const Eigen::PlainObjectBase<DerivedX>& X,
+    const Eigen::DenseBase<DerivedX>& X,
     Eigen::PlainObjectBase<DerivedI> & I);
     Eigen::PlainObjectBase<DerivedI> & I);
   // Find the non-zero entries and there respective indices in a sparse vector.
   // Find the non-zero entries and there respective indices in a sparse vector.
   // Similar to matlab's [I,J,V] = find(X), but instead of [I,J] being
   // Similar to matlab's [I,J,V] = find(X), but instead of [I,J] being