diff options
author | Gael Guennebaud <g.gael@free.fr> | 2019-01-15 15:21:14 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2019-01-15 15:21:14 +0100 |
commit | 6ec6bf0b0d405ec8c597368d089a292d12f9b39e (patch) | |
tree | 73318db7d5ca34dac6020d35913441752c48700f /Eigen/src/Core/Redux.h | |
parent | 027e44ed24f39697263263dfc7193d8fd9feeba8 (diff) |
Enable visitor on empty matrices (the visitor is left unchanged), and protect min/maxCoeff(Index*,Index*) on empty matrices by an assertion (+ doc & unit tests)
Diffstat (limited to 'Eigen/src/Core/Redux.h')
-rw-r--r-- | Eigen/src/Core/Redux.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Eigen/src/Core/Redux.h b/Eigen/src/Core/Redux.h index 720b6030c..e231a7d7d 100644 --- a/Eigen/src/Core/Redux.h +++ b/Eigen/src/Core/Redux.h @@ -397,6 +397,8 @@ public: * The template parameter \a BinaryOp is the type of the functor \a func which must be * an associative operator. Both current C++98 and C++11 functor styles are handled. * + * \warning the matrix must be not empty, otherwise an assertion is triggered. + * * \sa DenseBase::sum(), DenseBase::minCoeff(), DenseBase::maxCoeff(), MatrixBase::colwise(), MatrixBase::rowwise() */ template<typename Derived> @@ -415,6 +417,7 @@ DenseBase<Derived>::redux(const Func& func) const } /** \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> @@ -425,6 +428,7 @@ DenseBase<Derived>::minCoeff() const } /** \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> |