diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-08-24 00:23:35 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-08-24 00:23:35 -0400 |
commit | c9a307f3303ba7b49bc119ee0043df88d53cd995 (patch) | |
tree | 7e51f5e64c3086aede1f6740dd053e46cb3fcedf /test | |
parent | 154bdac9f4fe8b3b2b9a3089b87392c16ccd89e1 (diff) |
give FullPivotingHouseholderQR all the modern comfort
Diffstat (limited to 'test')
-rw-r--r-- | test/qr_fullpivoting.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp index fcbf08e4c..1e0601a83 100644 --- a/test/qr_fullpivoting.cpp +++ b/test/qr_fullpivoting.cpp @@ -39,6 +39,11 @@ template<typename MatrixType> void qr() createRandomMatrixOfRank(rank,rows,cols,m1); FullPivotingHouseholderQR<MatrixType> qr(m1); VERIFY_IS_APPROX(rank, qr.rank()); + VERIFY(cols - qr.rank() == qr.dimensionOfKernel()); + VERIFY(!qr.isInjective()); + VERIFY(!qr.isInvertible()); + VERIFY(!qr.isSurjective()); + MatrixType r = qr.matrixQR(); // FIXME need better way to construct trapezoid @@ -54,8 +59,10 @@ template<typename MatrixType> void qr() MatrixType m2 = MatrixType::Random(cols,cols2); MatrixType m3 = m1*m2; m2 = MatrixType::Random(cols,cols2); - qr.solve(m3, &m2); + VERIFY(qr.solve(m3, &m2)); VERIFY_IS_APPROX(m3, m1*m2); + m3 = MatrixType::Random(rows,cols2); + VERIFY(!qr.solve(m3, &m2)); } template<typename MatrixType> void qr_invertible() @@ -74,8 +81,12 @@ template<typename MatrixType> void qr_invertible() } FullPivotingHouseholderQR<MatrixType> qr(m1); + VERIFY(qr.isInjective()); + VERIFY(qr.isInvertible()); + VERIFY(qr.isSurjective()); + m3 = MatrixType::Random(size,size); - qr.solve(m3, &m2); + VERIFY(qr.solve(m3, &m2)); VERIFY_IS_APPROX(m3, m1*m2); } |