bug #1376: add missing assertion on size mismatch with compound assignment operators (e.g., mat += mat.col(j))

(grafted from ba3f977946
)
This commit is contained in:
Gael Guennebaud
2017-01-23 22:06:08 +01:00
parent f9b8729597
commit 35bf99c63e
6 changed files with 57 additions and 10 deletions

View File

@@ -186,6 +186,14 @@ template<typename MatrixType> void block(const MatrixType& m)
VERIFY_IS_EQUAL( (m1.template block<1,Dynamic>(0,1,1,0)), m1.block(0,1,1,0));
VERIFY_IS_EQUAL( ((m1*1).template block<Dynamic,1>(1,0,0,1)), m1.block(1,0,0,1));
VERIFY_IS_EQUAL( ((m1*1).template block<1,Dynamic>(0,1,1,0)), m1.block(0,1,1,0));
if (rows>=2 && cols>=2)
{
VERIFY_RAISES_ASSERT( m1 += m1.col(0) );
VERIFY_RAISES_ASSERT( m1 -= m1.col(0) );
VERIFY_RAISES_ASSERT( m1.array() *= m1.col(0).array() );
VERIFY_RAISES_ASSERT( m1.array() /= m1.col(0).array() );
}
}