diff options
Diffstat (limited to 'test/product_extra.cpp')
-rw-r--r-- | test/product_extra.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/product_extra.cpp b/test/product_extra.cpp index 25a9974b9..ca302b469 100644 --- a/test/product_extra.cpp +++ b/test/product_extra.cpp @@ -116,6 +116,16 @@ template<typename MatrixType> void product_extra(const MatrixType& m) VERIFY_IS_APPROX(tmp, m1 * m1.adjoint() * s1); } +// Regression test for bug reported at http://forum.kde.org/viewtopic.php?f=74&t=96947 +void mat_mat_scalar_scalar_product() +{ + Eigen::Matrix2Xd dNdxy(2, 3); + dNdxy << -0.5, 0.5, 0, + -0.3, 0, 0.3; + double det = 6.0, wt = 0.5; + VERIFY_IS_APPROX(dNdxy.transpose()*dNdxy*det*wt, det*wt*dNdxy.transpose()*dNdxy); +} + void zero_sized_objects() { // Bug 127 @@ -145,6 +155,7 @@ void test_product_extra() for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( product_extra(MatrixXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) ); CALL_SUBTEST_2( product_extra(MatrixXd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) ); + CALL_SUBTEST_2( mat_mat_scalar_scalar_product() ); CALL_SUBTEST_3( product_extra(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) ); CALL_SUBTEST_4( product_extra(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) ); CALL_SUBTEST_5( zero_sized_objects() ); |