From 7a1763995396e6119092ce5fc4ca2d536b6acb73 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 6 Oct 2014 11:41:50 +0200 Subject: Extend unit tests to check uncompressed sparse inputs in sparse solvers --- test/sparse_solver.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/sparse_solver.h') diff --git a/test/sparse_solver.h b/test/sparse_solver.h index d84aff070..8c8d7f939 100644 --- a/test/sparse_solver.h +++ b/test/sparse_solver.h @@ -67,6 +67,15 @@ void check_sparse_solving(Solver& solver, const typename Solver::MatrixType& A, VERIFY(oldb.isApprox(db) && "sparse solver testing: the rhs should not be modified!"); VERIFY(x.isApprox(refX,test_precision())); } + + // test uncompressed inputs + { + Mat A2 = A; + A2.reserve((ArrayXf::Random(A.outerSize())+2).template cast().eval()); + solver.compute(A2); + Rhs x = solver.solve(b); + VERIFY(x.isApprox(refX,test_precision())); + } } template -- cgit v1.2.3