diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index 94dddd27d..eeb1a2e8f 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -449,13 +449,21 @@ template class DenseBase EIGEN_DEVICE_FUNC Scalar prod() const; + template EIGEN_DEVICE_FUNC typename internal::traits::Scalar minCoeff() const; + template EIGEN_DEVICE_FUNC typename internal::traits::Scalar maxCoeff() const; - template - EIGEN_DEVICE_FUNC typename internal::traits::Scalar minCoeff() const; - template - EIGEN_DEVICE_FUNC typename internal::traits::Scalar maxCoeff() const; + // By default, the fastest version with undefined NaN propagation semantics is + // used. + EIGEN_DEVICE_FUNC typename internal::traits::Scalar minCoeff() const { + return minCoeff(); + } + EIGEN_DEVICE_FUNC typename internal::traits::Scalar maxCoeff() const { + return maxCoeff(); + } + + template EIGEN_DEVICE_FUNC typename internal::traits::Scalar minCoeff(IndexType* row, IndexType* col) const; diff --git a/Eigen/src/Core/Redux.h b/Eigen/src/Core/Redux.h index 4e5affc43..30598f415 100644 --- a/Eigen/src/Core/Redux.h +++ b/Eigen/src/Core/Redux.h @@ -418,17 +418,6 @@ DenseBase::redux(const Func& func) const return internal::redux_impl::run(thisEval, func, derived()); } -/** \returns the minimum of all coefficients of \c *this. - * \warning the matrix must be not empty, otherwise an assertion is triggered. - * \warning the result is undefined if \c *this contains NaN. - */ -template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits::Scalar -DenseBase::minCoeff() const -{ - return derived().redux(Eigen::internal::scalar_min_op()); -} - /** \returns the minimum of all coefficients of \c *this. * In case \c *this contains NaN, NaNPropagation determines the behavior: * NaNPropagation == PropagateFast : undefined @@ -444,17 +433,6 @@ DenseBase::minCoeff() const return derived().redux(Eigen::internal::scalar_min_op()); } -/** \returns the maximum of all coefficients of \c *this. - * \warning the matrix must be not empty, otherwise an assertion is triggered. - * \warning the result is undefined if \c *this contains NaN. - */ -template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits::Scalar -DenseBase::maxCoeff() const -{ - return derived().redux(Eigen::internal::scalar_max_op()); -} - /** \returns the maximum of all coefficients of \c *this. * In case \c *this contains NaN, NaNPropagation determines the behavior: * NaNPropagation == PropagateFast : undefined