From 1f11dd6cedc223f92f9ce99a22080dd267fcb488 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 28 Oct 2015 12:53:13 +0100 Subject: Add a unit test for large chains of products --- test/product_small.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/product_small.cpp') diff --git a/test/product_small.cpp b/test/product_small.cpp index 091955a0f..c561ec63b 100644 --- a/test/product_small.cpp +++ b/test/product_small.cpp @@ -56,5 +56,16 @@ void test_product_small() VERIFY_IS_APPROX(B * A.inverse(), B * A.inverse()[0]); VERIFY_IS_APPROX(A.inverse() * C, A.inverse()[0] * C); } + + { + Eigen::Matrix A, B, C; + A.setRandom(); + C = A; + for(int k=0; k<79; ++k) + C = C * A; + B.noalias() = (((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)) * ((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))) + * (((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)) * ((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))); + VERIFY_IS_APPROX(B,C); + } #endif } -- cgit v1.2.3