Bladeren bron

use matrixbase for inputs

Former-commit-id: b98b164f9424e0a848b8649481f0e8028da75c6b
Alec Jacobson 8 jaren geleden
bovenliggende
commit
f6076190a2
2 gewijzigde bestanden met toevoegingen van 15 en 15 verwijderingen
  1. 10 10
      include/igl/histc.cpp
  2. 5 5
      include/igl/histc.h

+ 10 - 10
include/igl/histc.cpp

@@ -12,8 +12,8 @@
 
 template <typename DerivedX, typename DerivedE, typename DerivedN, typename DerivedB>
 IGL_INLINE void igl::histc(
-  const Eigen::PlainObjectBase<DerivedX > & X,
-  const Eigen::PlainObjectBase<DerivedE > & E,
+  const Eigen::MatrixBase<DerivedX > & X,
+  const Eigen::MatrixBase<DerivedE > & E,
   Eigen::PlainObjectBase<DerivedN > & N,
   Eigen::PlainObjectBase<DerivedB > & B)
 {
@@ -36,8 +36,8 @@ IGL_INLINE void igl::histc(
 
 template <typename DerivedX, typename DerivedE, typename DerivedB>
 IGL_INLINE void igl::histc(
-  const Eigen::PlainObjectBase<DerivedX > & X,
-  const Eigen::PlainObjectBase<DerivedE > & E,
+  const Eigen::MatrixBase<DerivedX > & X,
+  const Eigen::MatrixBase<DerivedE > & E,
   Eigen::PlainObjectBase<DerivedB > & B)
 {
   const int m = X.size();
@@ -88,7 +88,7 @@ IGL_INLINE void igl::histc(
 template <typename DerivedE>
 IGL_INLINE void igl::histc(
     const typename DerivedE::Scalar & x,
-    const Eigen::PlainObjectBase<DerivedE > & E,
+    const Eigen::MatrixBase<DerivedE > & E,
     typename DerivedE::Index & b)
 {
   Eigen::Matrix<typename DerivedE::Scalar,1,1> X;
@@ -100,9 +100,9 @@ IGL_INLINE void igl::histc(
 
 #ifdef IGL_STATIC_LIBRARY
 // Explicit template specialization
-template void igl::histc<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::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
-template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
-template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
-template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::histc<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::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
 #endif

+ 5 - 5
include/igl/histc.h

@@ -28,21 +28,21 @@ namespace igl
   // O(n+m*log(n))
   template <typename DerivedX, typename DerivedE, typename DerivedN, typename DerivedB>
   IGL_INLINE void histc(
-    const Eigen::PlainObjectBase<DerivedX > & X,
-    const Eigen::PlainObjectBase<DerivedE > & E,
+    const Eigen::MatrixBase<DerivedX > & X,
+    const Eigen::MatrixBase<DerivedE > & E,
     Eigen::PlainObjectBase<DerivedN > & N,
     Eigen::PlainObjectBase<DerivedB > & B);
   // Truly O(m*log(n))
   template <typename DerivedX, typename DerivedE, typename DerivedB>
   IGL_INLINE void histc(
-    const Eigen::PlainObjectBase<DerivedX > & X,
-    const Eigen::PlainObjectBase<DerivedE > & E,
+    const Eigen::MatrixBase<DerivedX > & X,
+    const Eigen::MatrixBase<DerivedE > & E,
     Eigen::PlainObjectBase<DerivedB > & B);
   // Scalar search wrapper
   template <typename DerivedE>
   IGL_INLINE void histc(
     const typename DerivedE::Scalar & x,
-    const Eigen::PlainObjectBase<DerivedE > & E,
+    const Eigen::MatrixBase<DerivedE > & E,
     typename DerivedE::Index & b);
 }