From f0eb3d2d3b671c46d2c3b8c48037f6f8cd0100d3 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 12 May 2008 10:26:10 +0000 Subject: [PATCH] updated product test to carefully test all scalar types and fix an issue in the triangular test --- test/product.cpp | 18 +++++++++++------- test/triangular.cpp | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/test/product.cpp b/test/product.cpp index 782be8f82..6fdca2cda 100644 --- a/test/product.cpp +++ b/test/product.cpp @@ -95,15 +95,19 @@ void EigenTest::testProduct() { for(int i = 0; i < m_repeat; i++) { product(Matrix()); + product(Matrix()); + product(Matrix()); product(Matrix4d()); - product(MatrixXcf(3, 3)); - product(MatrixXf(13, 25)); - product(MatrixXi(4, 4)); - product(MatrixXcd(20, 20)); } - - // test a large matrix only once - product(MatrixXf(100,100)); + for(int i = 0; i < m_repeat; i++) { + int rows = ei_random(1,320); + int cols = ei_random(1,320); + product(MatrixXf(rows, cols)); + product(MatrixXd(rows, cols)); + product(MatrixXi(rows, cols)); + product(MatrixXcf(rows, cols)); + product(MatrixXcd(rows, cols)); + } } } // namespace Eigen diff --git a/test/triangular.cpp b/test/triangular.cpp index 3b26e246f..985c6aacd 100644 --- a/test/triangular.cpp +++ b/test/triangular.cpp @@ -70,13 +70,13 @@ template void triangular(const MatrixType& m) // test overloaded operator= m1.setZero(); - m1.upper() = m2.transpose() * m2; + m1.upper() = (m2.transpose() * m2).lazy(); m3 = m2.transpose() * m2; VERIFY_IS_APPROX(m3.lower().transpose(), m1); // test overloaded operator= m1.setZero(); - m1.lower() = m2.transpose() * m2; + m1.lower() = (m2.transpose() * m2).lazy(); VERIFY_IS_APPROX(m3.lower(), m1); // test back and forward subsitution