mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
Defer default for minCoeff/maxCoeff to templated variant.
This commit is contained in:
parent
4cb0592af7
commit
fb5b59641a
@ -449,13 +449,21 @@ template<typename Derived> class DenseBase
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC Scalar prod() const;
|
EIGEN_DEVICE_FUNC Scalar prod() const;
|
||||||
|
|
||||||
|
template<int NaNPropagation>
|
||||||
EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const;
|
EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const;
|
||||||
|
template<int NaNPropagation>
|
||||||
EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const;
|
EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const;
|
||||||
|
|
||||||
template<int NaNPropagation>
|
// By default, the fastest version with undefined NaN propagation semantics is
|
||||||
EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const;
|
// used.
|
||||||
template<int NaNPropagation>
|
EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar minCoeff() const {
|
||||||
EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const;
|
return minCoeff<PropagateFast>();
|
||||||
|
}
|
||||||
|
EIGEN_DEVICE_FUNC typename internal::traits<Derived>::Scalar maxCoeff() const {
|
||||||
|
return maxCoeff<PropagateFast>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename IndexType> EIGEN_DEVICE_FUNC
|
template<typename IndexType> EIGEN_DEVICE_FUNC
|
||||||
typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const;
|
typename internal::traits<Derived>::Scalar minCoeff(IndexType* row, IndexType* col) const;
|
||||||
|
@ -418,17 +418,6 @@ DenseBase<Derived>::redux(const Func& func) const
|
|||||||
return internal::redux_impl<Func, ThisEvaluator>::run(thisEval, func, derived());
|
return internal::redux_impl<Func, ThisEvaluator>::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<typename Derived>
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits<Derived>::Scalar
|
|
||||||
DenseBase<Derived>::minCoeff() const
|
|
||||||
{
|
|
||||||
return derived().redux(Eigen::internal::scalar_min_op<Scalar,Scalar>());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \returns the minimum of all coefficients of \c *this.
|
/** \returns the minimum of all coefficients of \c *this.
|
||||||
* In case \c *this contains NaN, NaNPropagation determines the behavior:
|
* In case \c *this contains NaN, NaNPropagation determines the behavior:
|
||||||
* NaNPropagation == PropagateFast : undefined
|
* NaNPropagation == PropagateFast : undefined
|
||||||
@ -444,17 +433,6 @@ DenseBase<Derived>::minCoeff() const
|
|||||||
return derived().redux(Eigen::internal::scalar_min_op<Scalar,Scalar, NaNPropagation>());
|
return derived().redux(Eigen::internal::scalar_min_op<Scalar,Scalar, NaNPropagation>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \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<typename Derived>
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::traits<Derived>::Scalar
|
|
||||||
DenseBase<Derived>::maxCoeff() const
|
|
||||||
{
|
|
||||||
return derived().redux(Eigen::internal::scalar_max_op<Scalar,Scalar>());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \returns the maximum of all coefficients of \c *this.
|
/** \returns the maximum of all coefficients of \c *this.
|
||||||
* In case \c *this contains NaN, NaNPropagation determines the behavior:
|
* In case \c *this contains NaN, NaNPropagation determines the behavior:
|
||||||
* NaNPropagation == PropagateFast : undefined
|
* NaNPropagation == PropagateFast : undefined
|
||||||
|
Loading…
x
Reference in New Issue
Block a user