aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/inverse.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-04-09 21:55:29 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-04-09 21:55:29 +0000
commit22edf77470020f418ccd485e600bd63d3d4e4315 (patch)
tree21655c1b8f2fb43141cc53871b6b32f45f575c72 /test/inverse.cpp
parentea41a18b80150baea3c9879d5b94930524f8d276 (diff)
add a 4x4 inverse case which is not handled by the current
ei_compute_inverse_in_size4_case (reported by mikola on IRC)
Diffstat (limited to 'test/inverse.cpp')
-rw-r--r--test/inverse.cpp6
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());
}