From c4ab6a2032895957e0e8dbea564b0c9c7f88b48a Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 12 Oct 2009 22:33:51 -0400 Subject: also test that the matrix Q is unitary --- test/qr_fullpivoting.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/qr_fullpivoting.cpp') diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp index 3a37bcb46..891c2a527 100644 --- a/test/qr_fullpivoting.cpp +++ b/test/qr_fullpivoting.cpp @@ -32,7 +32,7 @@ template void qr() int rank = ei_random(1, std::min(rows, cols)-1); typedef typename MatrixType::Scalar Scalar; - typedef Matrix SquareMatrixType; + typedef Matrix MatrixQType; typedef Matrix VectorType; MatrixType m1; createRandomMatrixOfRank(rank,rows,cols,m1); @@ -44,6 +44,10 @@ template void qr() VERIFY(!qr.isSurjective()); MatrixType r = qr.matrixQR(); + + MatrixQType q = qr.matrixQ(); + VERIFY_IS_UNITARY(q); + // FIXME need better way to construct trapezoid for(int i = 0; i < rows; i++) for(int j = 0; j < cols; j++) if(i>j) r(i,j) = Scalar(0); -- cgit v1.2.3