mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
fix += return by value like operations
This commit is contained in:
@@ -168,6 +168,21 @@ template<typename MatrixType> void cholesky(const MatrixType& m)
|
||||
}
|
||||
}
|
||||
|
||||
// test some special use cases of SelfCwiseBinaryOp:
|
||||
MatrixType m1 = MatrixType::Random(rows,cols), m2(rows,cols);
|
||||
m2 = m1;
|
||||
m2 += symmLo.template selfadjointView<Lower>().llt().solve(matB);
|
||||
VERIFY_IS_APPROX(m2, m1 + symmLo.template selfadjointView<Lower>().llt().solve(matB));
|
||||
m2 = m1;
|
||||
m2 -= symmLo.template selfadjointView<Lower>().llt().solve(matB);
|
||||
VERIFY_IS_APPROX(m2, m1 - symmLo.template selfadjointView<Lower>().llt().solve(matB));
|
||||
m2 = m1;
|
||||
m2.noalias() += symmLo.template selfadjointView<Lower>().llt().solve(matB);
|
||||
VERIFY_IS_APPROX(m2, m1 + symmLo.template selfadjointView<Lower>().llt().solve(matB));
|
||||
m2 = m1;
|
||||
m2.noalias() -= symmLo.template selfadjointView<Lower>().llt().solve(matB);
|
||||
VERIFY_IS_APPROX(m2, m1 - symmLo.template selfadjointView<Lower>().llt().solve(matB));
|
||||
|
||||
}
|
||||
|
||||
template<typename MatrixType> void cholesky_cplx(const MatrixType& m)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
template<typename MatrixType> void linearStructure(const MatrixType& m)
|
||||
{
|
||||
/* this test covers the following files:
|
||||
Sum.h Difference.h Opposite.h ScalarMultiple.h
|
||||
CwiseUnaryOp.h, CwiseBinaryOp.h, SelfCwiseBinaryOp.h
|
||||
*/
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
|
||||
Reference in New Issue
Block a user