mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-21 17:19:36 +08:00
Added regression tests for bug #148.
This commit is contained in:
parent
fd400ffffb
commit
d5e81d866a
@ -76,6 +76,14 @@ template<typename MatrixType> void array_for_matrix(const MatrixType& m)
|
|||||||
// empty objects
|
// empty objects
|
||||||
VERIFY_IS_APPROX(m1.block(0,0,0,cols).colwise().sum(), RowVectorType::Zero(cols));
|
VERIFY_IS_APPROX(m1.block(0,0,0,cols).colwise().sum(), RowVectorType::Zero(cols));
|
||||||
VERIFY_IS_APPROX(m1.block(0,0,rows,0).rowwise().prod(), ColVectorType::Ones(rows));
|
VERIFY_IS_APPROX(m1.block(0,0,rows,0).rowwise().prod(), ColVectorType::Ones(rows));
|
||||||
|
|
||||||
|
// verify the const accessors exist
|
||||||
|
const Scalar& ref_m1 = m.matrix().array().coeffRef(0);
|
||||||
|
const Scalar& ref_m2 = m.matrix().array().coeffRef(0,0);
|
||||||
|
const Scalar& ref_a1 = m.array().matrix().coeffRef(0);
|
||||||
|
const Scalar& ref_a2 = m.array().matrix().coeffRef(0,0);
|
||||||
|
VERIFY(&ref_a1 == &ref_m1);
|
||||||
|
VERIFY(&ref_a2 == &ref_m2);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename MatrixType> void comparisons(const MatrixType& m)
|
template<typename MatrixType> void comparisons(const MatrixType& m)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user