From 6ec6bf0b0d405ec8c597368d089a292d12f9b39e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 15 Jan 2019 15:21:14 +0100 Subject: 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) --- test/zerosized.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/zerosized.cpp') 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 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) ); } -- cgit v1.2.3