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 /test/zerosized.cpp | |
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 'test/zerosized.cpp')
-rw-r--r-- | test/zerosized.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/zerosized.cpp b/test/zerosized.cpp index 6be136e25..07afd0f86 100644 --- a/test/zerosized.cpp +++ b/test/zerosized.cpp @@ -23,6 +23,11 @@ template<typename MatrixType> void zeroReduction(const MatrixType& m) { VERIFY(!m.hasNaN()); VERIFY_RAISES_ASSERT( m.minCoeff() ); VERIFY_RAISES_ASSERT( m.maxCoeff() ); + Index i,j; + VERIFY_RAISES_ASSERT( m.minCoeff(&i,&j) ); + VERIFY_RAISES_ASSERT( m.maxCoeff(&i,&j) ); + VERIFY_RAISES_ASSERT( m.reshaped().minCoeff(&i) ); + VERIFY_RAISES_ASSERT( m.reshaped().maxCoeff(&i) ); } |