From cf939f154fe1ec9904276f5f3f2dbdbc8e98156a Mon Sep 17 00:00:00 2001 From: Desire NUENTSA Date: Tue, 21 May 2013 17:35:10 +0200 Subject: Fix bug #596 : Recover plain SparseMatrix from SparseQR matrixQ() --- test/sparseqr.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/sparseqr.cpp') diff --git a/test/sparseqr.cpp b/test/sparseqr.cpp index 66c7c005e..6edba30b2 100644 --- a/test/sparseqr.cpp +++ b/test/sparseqr.cpp @@ -71,6 +71,14 @@ template void test_sparseqr_scalar() VERIFY((dA * refX - b).norm() * 2 > (A * x - b).norm() ); else VERIFY_IS_APPROX(x, refX); + + // Compute explicitly the matrix Q + MatrixType Q, QtQ, idM; + Q = solver.matrixQ(); + //Check ||Q' * Q - I || + QtQ = Q * Q.adjoint(); + idM.resize(Q.rows(), Q.rows()); idM.setIdentity(); + VERIFY(idM.isApprox(QtQ)); } void test_sparseqr() { -- cgit v1.2.3