diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-11-17 08:14:54 -0500 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-11-17 08:14:54 -0500 |
commit | 9f21e2aab7953b84c323258177b615ea6cff91ce (patch) | |
tree | 0cbb81d232e956747b7087bbba5bcdad2744c345 /test/qr_fullpivoting.cpp | |
parent | 30b610a10f764529c7f93b6b7cd3cbf86a36e73d (diff) |
port the QR module to PermutationMatrix
Diffstat (limited to 'test/qr_fullpivoting.cpp')
-rw-r--r-- | test/qr_fullpivoting.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp index 65d9a071f..c82ba4c7e 100644 --- a/test/qr_fullpivoting.cpp +++ b/test/qr_fullpivoting.cpp @@ -51,11 +51,8 @@ template<typename MatrixType> void qr() // 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); - MatrixType b = qr.matrixQ() * r; + MatrixType c = qr.matrixQ() * r * qr.colsPermutation().inverse(); - MatrixType c = MatrixType::Zero(rows,cols); - - for(int i = 0; i < cols; ++i) c.col(qr.colsPermutation().coeff(i)) = b.col(i); VERIFY_IS_APPROX(m1, c); MatrixType m2 = MatrixType::Random(cols,cols2); |