From 9d2b6dd71ab55c8332321c01348eac491b94975f Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 6 Jun 2012 09:40:01 +0200 Subject: [PATCH] test block objects for sparse solving --- test/sparse_solver.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/sparse_solver.h b/test/sparse_solver.h index 1bbaeb2dd..43f157eb2 100644 --- a/test/sparse_solver.h +++ b/test/sparse_solver.h @@ -72,6 +72,16 @@ void check_sparse_solving(Solver& solver, const typename Solver::MatrixType& A, VERIFY(oldb.isApprox(b) && "sparse solver testing: the rhs should not be modified!"); VERIFY(x.isApprox(refX,test_precision())); + + // test Block as the result and rhs: + { + DenseRhs x(db.rows(), db.cols()); + DenseRhs b(db), oldb(db); + x.setZero(); + x.block(0,0,x.rows(),x.cols()) = solver.solve(b.block(0,0,b.rows(),b.cols())); + VERIFY(oldb.isApprox(b) && "sparse solver testing: the rhs should not be modified!"); + VERIFY(x.isApprox(refX,test_precision())); + } } template