Fix bug #596 : Recover plain SparseMatrix from SparseQR matrixQ()

This commit is contained in:
Desire NUENTSA
2013-05-21 17:35:10 +02:00
parent bd7511fc36
commit cf939f154f
5 changed files with 112 additions and 28 deletions

View File

@@ -71,6 +71,14 @@ template<typename Scalar> 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()
{