aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/qr_fullpivoting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/qr_fullpivoting.cpp')
-rw-r--r--test/qr_fullpivoting.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp
index 05a705887..70e89c198 100644
--- a/test/qr_fullpivoting.cpp
+++ b/test/qr_fullpivoting.cpp
@@ -54,6 +54,18 @@ template<typename MatrixType> void qr()
m2 = MatrixType::Random(cols,cols2);
m2 = qr.solve(m3);
VERIFY_IS_APPROX(m3, m1*m2);
+
+ {
+ Index size = rows;
+ do {
+ m1 = MatrixType::Random(size,size);
+ qr.compute(m1);
+ } while(!qr.isInvertible());
+ MatrixType m1_inv = qr.inverse();
+ m3 = m1 * MatrixType::Random(size,cols2);
+ m2 = qr.solve(m3);
+ VERIFY_IS_APPROX(m2, m1_inv*m3);
+ }
}
template<typename MatrixType> void qr_invertible()