From 43c987b1c164aeacffc3650a367587e56da31504 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 16 Nov 2018 11:24:51 +0100 Subject: Add explicit regression test for bug #1622 --- test/product_large.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/product_large.cpp') diff --git a/test/product_large.cpp b/test/product_large.cpp index ae14b714c..578dfb54b 100644 --- a/test/product_large.cpp +++ b/test/product_large.cpp @@ -8,6 +8,7 @@ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #include "product.h" +#include template void test_aliasing() @@ -87,6 +88,16 @@ void product_large_regressions() } } +template +void bug_1622() { + typedef Matrix Mat2X; + Mat2X x(2,2); x.setRandom(); + MatrixXd y(2,2); y.setRandom(); + const Mat2X K1 = x * y.inverse(); + const Matrix2d K2 = x * y.inverse(); + VERIFY_IS_APPROX(K1,K2); +} + EIGEN_DECLARE_TEST(product_large) { for(int i = 0; i < g_repeat; i++) { @@ -99,6 +110,8 @@ EIGEN_DECLARE_TEST(product_large) CALL_SUBTEST_5( product(Matrix(internal::random(1,EIGEN_TEST_MAX_SIZE), internal::random(1,EIGEN_TEST_MAX_SIZE))) ); CALL_SUBTEST_1( test_aliasing() ); + + CALL_SUBTEST_6( bug_1622<1>() ); } CALL_SUBTEST_6( product_large_regressions<0>() ); -- cgit v1.2.3