From 3946c981b12827c94f62fc1862f121468f972a2c Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 15 Jun 2015 15:08:16 +0200 Subject: Relax tolerance when testing LDLT on singular problems --- test/cholesky.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test/cholesky.cpp') diff --git a/test/cholesky.cpp b/test/cholesky.cpp index 9335270f4..16db380f6 100644 --- a/test/cholesky.cpp +++ b/test/cholesky.cpp @@ -225,7 +225,20 @@ template void cholesky(const MatrixType& m) ldltlo.compute(A); VERIFY_IS_APPROX(A, ldltlo.reconstructedMatrix()); 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()); + VERIFY((A * vecX).isApprox(vecB, large_tol)); + + ++g_test_level; + VERIFY_IS_APPROX(A * vecX,vecB); + --g_test_level; + } } } -- cgit v1.2.3