mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-22 04:44:25 +08:00
Relax tolerance when testing LDLT on singular problems
This commit is contained in:
parent
2212e40e95
commit
3946c981b1
@ -225,7 +225,20 @@ template<typename MatrixType> void cholesky(const MatrixType& m)
|
|||||||
ldltlo.compute(A);
|
ldltlo.compute(A);
|
||||||
VERIFY_IS_APPROX(A, ldltlo.reconstructedMatrix());
|
VERIFY_IS_APPROX(A, ldltlo.reconstructedMatrix());
|
||||||
vecX = ldltlo.solve(vecB);
|
vecX = ldltlo.solve(vecB);
|
||||||
VERIFY_IS_APPROX(A * vecX, vecB);
|
|
||||||
|
if(ldltlo.vectorD().real().cwiseAbs().minCoeff()>RealScalar(0))
|
||||||
|
{
|
||||||
|
VERIFY_IS_APPROX(A * vecX,vecB);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RealScalar large_tol = std::sqrt(test_precision<RealScalar>());
|
||||||
|
VERIFY((A * vecX).isApprox(vecB, large_tol));
|
||||||
|
|
||||||
|
++g_test_level;
|
||||||
|
VERIFY_IS_APPROX(A * vecX,vecB);
|
||||||
|
--g_test_level;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user