This commit is contained in:
Benoit Jacob 2011-01-25 21:28:20 -05:00
parent 39536d44da
commit c350f6f12c
2 changed files with 19 additions and 65 deletions

View File

@ -415,17 +415,14 @@ template<typename Derived> class DenseBase
typename internal::traits<Derived>::Scalar minCoeff() const; typename internal::traits<Derived>::Scalar minCoeff() const;
typename internal::traits<Derived>::Scalar maxCoeff() const; typename internal::traits<Derived>::Scalar maxCoeff() const;
typename internal::traits<Derived>::Scalar minCoeff(Index* row, Index* col) const; template<typename IndexType>
typename internal::traits<Derived>::Scalar maxCoeff(Index* row, Index* col) const; typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const;
typename internal::traits<Derived>::Scalar minCoeff(Index* index) const; template<typename IndexType>
typename internal::traits<Derived>::Scalar maxCoeff(Index* index) const; typename internal::traits<Derived>::Scalar maxCoeff(IndexType* row, IndexType* col) const;
template<typename IndexType>
#ifdef EIGEN2_SUPPORT typename internal::traits<Derived>::Scalar minCoeff(IndexType* index) const;
typename internal::traits<Derived>::Scalar minCoeff(int* row, int* col) const; template<typename IndexType>
typename internal::traits<Derived>::Scalar maxCoeff(int* row, int* col) const; typename internal::traits<Derived>::Scalar maxCoeff(IndexType* index) const;
typename internal::traits<Derived>::Scalar minCoeff(int* index) const;
typename internal::traits<Derived>::Scalar maxCoeff(int* index) const;
#endif
template<typename BinaryOp> template<typename BinaryOp>
typename internal::result_of<BinaryOp(typename internal::traits<Derived>::Scalar)>::type typename internal::result_of<BinaryOp(typename internal::traits<Derived>::Scalar)>::type

View File

@ -183,8 +183,9 @@ struct functor_traits<max_coeff_visitor<Scalar> > {
* \sa DenseBase::minCoeff(Index*), DenseBase::maxCoeff(Index*,Index*), DenseBase::visitor(), DenseBase::minCoeff() * \sa DenseBase::minCoeff(Index*), DenseBase::maxCoeff(Index*,Index*), DenseBase::visitor(), DenseBase::minCoeff()
*/ */
template<typename Derived> template<typename Derived>
template<typename IndexType>
typename internal::traits<Derived>::Scalar typename internal::traits<Derived>::Scalar
DenseBase<Derived>::minCoeff(Index* row, Index* col) const DenseBase<Derived>::minCoeff(IndexType* row, IndexType* col) const
{ {
internal::min_coeff_visitor<Derived> minVisitor; internal::min_coeff_visitor<Derived> minVisitor;
this->visit(minVisitor); this->visit(minVisitor);
@ -196,11 +197,12 @@ DenseBase<Derived>::minCoeff(Index* row, Index* col) const
/** \returns the minimum of all coefficients of *this /** \returns the minimum of all coefficients of *this
* and puts in *index its location. * 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<typename Derived> template<typename Derived>
template<typename IndexType>
typename internal::traits<Derived>::Scalar typename internal::traits<Derived>::Scalar
DenseBase<Derived>::minCoeff(Index* index) const DenseBase<Derived>::minCoeff(IndexType* index) const
{ {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
internal::min_coeff_visitor<Derived> minVisitor; internal::min_coeff_visitor<Derived> minVisitor;
@ -212,11 +214,12 @@ DenseBase<Derived>::minCoeff(Index* index) const
/** \returns the maximum of all coefficients of *this /** \returns the maximum of all coefficients of *this
* and puts in *row and *col its location. * 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<typename Derived> template<typename Derived>
template<typename IndexType>
typename internal::traits<Derived>::Scalar typename internal::traits<Derived>::Scalar
DenseBase<Derived>::maxCoeff(Index* row, Index* col) const DenseBase<Derived>::maxCoeff(IndexType* row, IndexType* col) const
{ {
internal::max_coeff_visitor<Derived> maxVisitor; internal::max_coeff_visitor<Derived> maxVisitor;
this->visit(maxVisitor); this->visit(maxVisitor);
@ -228,11 +231,12 @@ DenseBase<Derived>::maxCoeff(Index* row, Index* col) const
/** \returns the maximum of all coefficients of *this /** \returns the maximum of all coefficients of *this
* and puts in *index its location. * 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<typename Derived> template<typename Derived>
template<typename IndexType>
typename internal::traits<Derived>::Scalar typename internal::traits<Derived>::Scalar
DenseBase<Derived>::maxCoeff(Index* index) const DenseBase<Derived>::maxCoeff(IndexType* index) const
{ {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
internal::max_coeff_visitor<Derived> maxVisitor; internal::max_coeff_visitor<Derived> maxVisitor;
@ -241,51 +245,4 @@ DenseBase<Derived>::maxCoeff(Index* index) const
return maxVisitor.res; return maxVisitor.res;
} }
#ifdef EIGEN2_SUPPORT
template<typename Derived>
typename internal::traits<Derived>::Scalar
DenseBase<Derived>::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 Derived>
typename internal::traits<Derived>::Scalar
DenseBase<Derived>::minCoeff(int* index) const
{
Index i;
Scalar result = this->minCoeff(&i);
*index = int(i);
return result;
}
template<typename Derived>
typename internal::traits<Derived>::Scalar
DenseBase<Derived>::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 Derived>
typename internal::traits<Derived>::Scalar
DenseBase<Derived>::maxCoeff(int* index) const
{
Index i;
Scalar result = this->maxCoeff(&i);
*index = int(i);
return result;
}
#endif // EIGEN2_SUPPORT
#endif // EIGEN_VISITOR_H #endif // EIGEN_VISITOR_H