mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix bug #596 : Recover plain SparseMatrix from SparseQR matrixQ()
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user