From c350f6f12c85ee5c52cda82326f580dfbc9eb69f Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Tue, 25 Jan 2011 21:28:20 -0500 Subject: fix bug #161 --- Eigen/src/Core/Visitor.h | 65 ++++++++---------------------------------------- 1 file changed, 11 insertions(+), 54 deletions(-) (limited to 'Eigen/src/Core/Visitor.h') diff --git a/Eigen/src/Core/Visitor.h b/Eigen/src/Core/Visitor.h index 556c6fcd7..378ebcba1 100644 --- a/Eigen/src/Core/Visitor.h +++ b/Eigen/src/Core/Visitor.h @@ -183,8 +183,9 @@ struct functor_traits > { * \sa DenseBase::minCoeff(Index*), DenseBase::maxCoeff(Index*,Index*), DenseBase::visitor(), DenseBase::minCoeff() */ template +template typename internal::traits::Scalar -DenseBase::minCoeff(Index* row, Index* col) const +DenseBase::minCoeff(IndexType* row, IndexType* col) const { internal::min_coeff_visitor minVisitor; this->visit(minVisitor); @@ -196,11 +197,12 @@ DenseBase::minCoeff(Index* row, Index* col) const /** \returns the minimum of all coefficients of *this * and puts in *index its location. * - * \sa DenseBase::minCoeff(Index*,Index*), DenseBase::maxCoeff(Index*,Index*), DenseBase::visitor(), DenseBase::minCoeff() + * \sa DenseBase::minCoeff(IndexType*,IndexType*), DenseBase::maxCoeff(IndexType*,IndexType*), DenseBase::visitor(), DenseBase::minCoeff() */ template +template typename internal::traits::Scalar -DenseBase::minCoeff(Index* index) const +DenseBase::minCoeff(IndexType* index) const { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) internal::min_coeff_visitor minVisitor; @@ -212,11 +214,12 @@ DenseBase::minCoeff(Index* index) const /** \returns the maximum of all coefficients of *this * and puts in *row and *col its location. * - * \sa DenseBase::minCoeff(Index*,Index*), DenseBase::visitor(), DenseBase::maxCoeff() + * \sa DenseBase::minCoeff(IndexType*,IndexType*), DenseBase::visitor(), DenseBase::maxCoeff() */ template +template typename internal::traits::Scalar -DenseBase::maxCoeff(Index* row, Index* col) const +DenseBase::maxCoeff(IndexType* row, IndexType* col) const { internal::max_coeff_visitor maxVisitor; this->visit(maxVisitor); @@ -228,11 +231,12 @@ DenseBase::maxCoeff(Index* row, Index* col) const /** \returns the maximum of all coefficients of *this * and puts in *index its location. * - * \sa DenseBase::maxCoeff(Index*,Index*), DenseBase::minCoeff(Index*,Index*), DenseBase::visitor(), DenseBase::maxCoeff() + * \sa DenseBase::maxCoeff(IndexType*,IndexType*), DenseBase::minCoeff(IndexType*,IndexType*), DenseBase::visitor(), DenseBase::maxCoeff() */ template +template typename internal::traits::Scalar -DenseBase::maxCoeff(Index* index) const +DenseBase::maxCoeff(IndexType* index) const { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) internal::max_coeff_visitor maxVisitor; @@ -241,51 +245,4 @@ DenseBase::maxCoeff(Index* index) const return maxVisitor.res; } -#ifdef EIGEN2_SUPPORT - -template -typename internal::traits::Scalar -DenseBase::minCoeff(int* row, int* col) const -{ - Index r, c; - Scalar result = this->minCoeff(&r, &c); - *row = int(r); - *col = int(c); - return result; -} - -template -typename internal::traits::Scalar -DenseBase::minCoeff(int* index) const -{ - Index i; - Scalar result = this->minCoeff(&i); - *index = int(i); - return result; -} - -template -typename internal::traits::Scalar -DenseBase::maxCoeff(int* row, int* col) const -{ - Index r, c; - Scalar result = this->maxCoeff(&r, &c); - *row = int(r); - *col = int(c); - return result; -} - -template -typename internal::traits::Scalar -DenseBase::maxCoeff(int* index) const -{ - Index i; - Scalar result = this->maxCoeff(&i); - *index = int(i); - return result; -} - -#endif // EIGEN2_SUPPORT - - #endif // EIGEN_VISITOR_H -- cgit v1.2.3