bug #1592: makes partial min/max reductions trigger an assertion on inputs with a zero reduction length (+doc and tests)

This commit is contained in:
Gael Guennebaud
2019-01-15 15:13:24 +01:00
parent f8bc5cb39e
commit 027e44ed24
3 changed files with 59 additions and 3 deletions

View File

@@ -16,9 +16,13 @@ template<typename MatrixType> void zeroReduction(const MatrixType& m) {
VERIFY(!m.any());
VERIFY(m.prod()==1);
VERIFY(m.sum()==0);
VERIFY(m.norm()==0);
VERIFY(m.squaredNorm()==0);
VERIFY(m.count()==0);
VERIFY(m.allFinite());
VERIFY(!m.hasNaN());
VERIFY_RAISES_ASSERT( m.minCoeff() );
VERIFY_RAISES_ASSERT( m.maxCoeff() );
}