diff options
Diffstat (limited to 'test/inverse.cpp')
-rw-r--r-- | test/inverse.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/inverse.cpp b/test/inverse.cpp index 54dab489d..d619543a8 100644 --- a/test/inverse.cpp +++ b/test/inverse.cpp @@ -77,4 +77,10 @@ void test_inverse() CALL_SUBTEST( inverse(MatrixXf(8,8)) ); CALL_SUBTEST( inverse(MatrixXcd(7,7)) ); } + + // test some tricky cases for 4x4 matrices + VERIFY_IS_APPROX((Matrix4f() << 0,0,1,0, 1,0,0,0, 0,1,0,0, 0,0,0,1).finished().inverse(), + (Matrix4f() << 0,1,0,0, 0,0,1,0, 1,0,0,0, 0,0,0,1).finished()); + VERIFY_IS_APPROX((Matrix4f() << 1,0,0,0, 0,0,1,0, 0,0,0,1, 0,1,0,0).finished().inverse(), + (Matrix4f() << 1,0,0,0, 0,0,0,1, 0,1,0,0, 0,0,1,0).finished()); } |