|
@@ -7,12 +7,12 @@
|
|
|
// obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
#include "mat_max.h"
|
|
|
|
|
|
-template <typename T>
|
|
|
+template <typename DerivedX, typename DerivedY, typename DerivedI>
|
|
|
IGL_INLINE void igl::mat_max(
|
|
|
- const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> & X,
|
|
|
+ const Eigen::DenseBase<DerivedX> & X,
|
|
|
const int dim,
|
|
|
- Eigen::Matrix<T,Eigen::Dynamic,1> & Y,
|
|
|
- Eigen::Matrix<int,Eigen::Dynamic,1> & I)
|
|
|
+ Eigen::PlainObjectBase<DerivedY> & Y,
|
|
|
+ Eigen::PlainObjectBase<DerivedI> & I)
|
|
|
{
|
|
|
assert(dim==1||dim==2);
|
|
|
|
|
@@ -25,9 +25,8 @@ IGL_INLINE void igl::mat_max(
|
|
|
// loop over dimension opposite of dim
|
|
|
for(int j = 0;j<n;j++)
|
|
|
{
|
|
|
- typename Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>::Index PHONY;
|
|
|
- typename Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>::Index i;
|
|
|
- T m;
|
|
|
+ typename DerivedX::Index PHONY,i;
|
|
|
+ typename DerivedX::Scalar m;
|
|
|
if(dim==1)
|
|
|
{
|
|
|
m = X.col(j).maxCoeff(&i,&PHONY);
|
|
@@ -42,5 +41,4 @@ IGL_INLINE void igl::mat_max(
|
|
|
|
|
|
#ifdef IGL_STATIC_LIBRARY
|
|
|
// Explicit template specialization
|
|
|
-template void igl::mat_max<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, int, Eigen::Matrix<double, -1, 1, 0, -1, 1>&, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
|
|
|
#endif
|