mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 01:29:35 +08:00
Use internal::ref_selector to avoid holding a reference to a RHS expression.
This commit is contained in:
parent
ea62c937ed
commit
4ad30a73fc
@ -77,7 +77,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
const Decomposition &m_dec;
|
const Decomposition &m_dec;
|
||||||
const RhsType &m_rhs;
|
const typename internal::ref_selector<RhsType>::type m_rhs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,6 +31,10 @@ void check_solverbase(const MatrixType& matrix, const SolverType& solver, Index
|
|||||||
solver_solution2 = RhsType::Random(rows,cols2);
|
solver_solution2 = RhsType::Random(rows,cols2);
|
||||||
solver_solution2 = solver.adjoint().solve(m2);
|
solver_solution2 = solver.adjoint().solve(m2);
|
||||||
VERIFY_IS_APPROX(m2, matrix.adjoint()*solver_solution2);
|
VERIFY_IS_APPROX(m2, matrix.adjoint()*solver_solution2);
|
||||||
|
// test with temporary expression as rhs
|
||||||
|
m2 = DstType::Random(cols,cols2);
|
||||||
|
solver_solution = solver.solve(matrix*m2);
|
||||||
|
VERIFY_IS_APPROX(matrix*m2, matrix*solver_solution);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TEST_SOLVERBASE_H
|
#endif // TEST_SOLVERBASE_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user