bug #679: add respective unit test

(transplanted from 2c0303c89e
)
This commit is contained in:
Gael Guennebaud 2013-10-15 23:51:01 +02:00
parent 941319a198
commit 0257cf1cef

View File

@ -163,10 +163,14 @@ template<typename MatrixType> void cwise_min_max(const MatrixType& m)
// min/max with scalar input
VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1), m1.cwiseMin( minM1));
VERIFY_IS_APPROX(m1, m1.cwiseMin( maxM1));
VERIFY_IS_APPROX(m1, m1.cwiseMin(maxM1));
VERIFY_IS_APPROX(-m1, (-m1).cwiseMin(-minM1));
VERIFY_IS_APPROX(-m1.array(), ((-m1).array().min)( -minM1));
VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, maxM1), m1.cwiseMax( maxM1));
VERIFY_IS_APPROX(m1, m1.cwiseMax( minM1));
VERIFY_IS_APPROX(m1, m1.cwiseMax(minM1));
VERIFY_IS_APPROX(-m1, (-m1).cwiseMax(-maxM1));
VERIFY_IS_APPROX(-m1.array(), ((-m1).array().max)(-maxM1));
VERIFY_IS_APPROX(MatrixType::Constant(rows,cols, minM1).array(), (m1.array().min)( minM1));
VERIFY_IS_APPROX(m1.array(), (m1.array().min)( maxM1));