From 22edf77470020f418ccd485e600bd63d3d4e4315 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 9 Apr 2009 21:55:29 +0000 Subject: add a 4x4 inverse case which is not handled by the current ei_compute_inverse_in_size4_case (reported by mikola on IRC) --- test/inverse.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/inverse.cpp') 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()); } -- cgit v1.2.3