Show call stack in case of failing sparse solving.

This commit is contained in:
Gael Guennebaud 2018-10-16 00:43:44 +02:00
parent d2d570c116
commit e3b85771d7

View File

@ -59,7 +59,11 @@ void check_sparse_solving(Solver& solver, const typename Solver::MatrixType& A,
x = solver.solve(b); x = solver.solve(b);
if (solver.info() != Success) if (solver.info() != Success)
{ {
std::cerr << "WARNING | sparse solver testing: solving failed (" << typeid(Solver).name() << ")\n"; std::cerr << "WARNING: sparse solver testing: solving failed (" << typeid(Solver).name() << ")\n";
// dump call stack:
g_test_level++;
VERIFY(solver.info() == Success);
g_test_level--;
return; return;
} }
VERIFY(oldb.isApprox(b) && "sparse solver testing: the rhs should not be modified!"); VERIFY(oldb.isApprox(b) && "sparse solver testing: the rhs should not be modified!");
@ -67,7 +71,7 @@ void check_sparse_solving(Solver& solver, const typename Solver::MatrixType& A,
x.setZero(); x.setZero();
solve_with_guess(solver, b, x, x); solve_with_guess(solver, b, x, x);
VERIFY(solver.info() == Success && "solving failed when using analyzePattern/factorize API"); VERIFY(solver.info() == Success && "solving failed when using solve_with_guess API");
VERIFY(oldb.isApprox(b) && "sparse solver testing: the rhs should not be modified!"); VERIFY(oldb.isApprox(b) && "sparse solver testing: the rhs should not be modified!");
VERIFY(x.isApprox(refX,test_precision<Scalar>())); VERIFY(x.isApprox(refX,test_precision<Scalar>()));
@ -429,8 +433,7 @@ template<typename Solver> void check_sparse_square_solving(Solver& solver, int m
// check only once // check only once
if(i==0) if(i==0)
{ {
b = DenseVector::Zero(size); CALL_SUBTEST(b = DenseVector::Zero(size); check_sparse_solving(solver, A, b, dA, b));
check_sparse_solving(solver, A, b, dA, b);
} }
// regression test for Bug 792 (structurally rank deficient matrices): // regression test for Bug 792 (structurally rank deficient matrices):
if(checkDeficient && size>1) { if(checkDeficient && size>1) {