aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/qr_fullpivoting.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-10-06 09:55:50 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-10-06 09:55:50 +0200
commit80b513378948f78bc7729c431eb68ca5513a1d62 (patch)
tree8b2834ca1dc5fbabff23bd3de29435d95692c888 /test/qr_fullpivoting.cpp
parent4387433acf9cd2eab3713349163cd1e8905b5854 (diff)
Fix compilation of qr.inverse() for column and full pivoting variants.
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()