aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/inverse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/inverse.cpp')
-rw-r--r--test/inverse.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/inverse.cpp b/test/inverse.cpp
index 8187b088d..1e7b20958 100644
--- a/test/inverse.cpp
+++ b/test/inverse.cpp
@@ -68,6 +68,15 @@ template<typename MatrixType> void inverse(const MatrixType& m)
VERIFY_IS_MUCH_SMALLER_THAN(abs(det-m3.determinant()), RealScalar(1));
m3.computeInverseWithCheck(m4, invertible);
VERIFY( rows==1 ? invertible : !invertible );
+
+ // check with submatrices
+ {
+ Matrix<Scalar, MatrixType::RowsAtCompileTime+1, MatrixType::RowsAtCompileTime+1, MatrixType::Options> m3;
+ m3.setRandom();
+ m3.topLeftCorner(rows,rows) = m1;
+ m2 = m3.template topLeftCorner<MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime>().inverse();
+ VERIFY_IS_APPROX( (m3.template topLeftCorner<MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime>()), m2.inverse() );
+ }
#endif
// check in-place inversion