From 88b551e89bd34367c12f0ba540ee1134c6897ba1 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 19 Nov 2009 19:20:19 -0500 Subject: * fix compilation of unit-tests (sorry, had tested only 1 channel) * remove buggy (superfluous?) specialization in the meta-unroller --- test/triangular.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'test/triangular.cpp') diff --git a/test/triangular.cpp b/test/triangular.cpp index 3c89a8abb..a10b457a7 100644 --- a/test/triangular.cpp +++ b/test/triangular.cpp @@ -141,7 +141,10 @@ template void triangular_rect(const MatrixType& m) { typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; - typedef Matrix VectorType; + enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime }; + typedef Matrix VectorType; + typedef Matrix RMatrixType; + int rows = m.rows(); int cols = m.cols(); @@ -153,10 +156,10 @@ template void triangular_rect(const MatrixType& m) r1(rows, cols), r2(rows, cols), mzero = MatrixType::Zero(rows, cols), - mones = MatrixType::Ones(rows, cols), - identity = Matrix + mones = MatrixType::Ones(rows, cols); + RMatrixType identity = Matrix ::Identity(rows, rows), - square = Matrix + square = Matrix ::Random(rows, rows); VectorType v1 = VectorType::Random(rows), v2 = VectorType::Random(rows), @@ -172,8 +175,6 @@ template void triangular_rect(const MatrixType& m) VERIFY(!m2.isLowerTriangular()); } -// VERIFY_IS_APPROX(m1up.transpose() * m2, m1.upper().transpose().lower() * m2); - // test overloaded operator+= r1.setZero(); r2.setZero(); @@ -227,25 +228,30 @@ template void triangular_rect(const MatrixType& m) m3.setZero(); m3.template triangularView().setOnes(); VERIFY_IS_APPROX(m2,m3); - } void test_triangular() { - for(int i = 0; i < g_repeat ; i++) { + for(int i = 0; i < g_repeat ; i++) + { + +#ifdef EIGEN_TEST_PART_7 + int r = ei_random(2,20); + int c = ei_random(2,20); +#endif + CALL_SUBTEST_1( triangular_square(Matrix()) ); CALL_SUBTEST_2( triangular_square(Matrix()) ); CALL_SUBTEST_3( triangular_square(Matrix3d()) ); CALL_SUBTEST_4( triangular_square(MatrixXcf(4, 4)) ); CALL_SUBTEST_5( triangular_square(Matrix,8, 8>()) ); CALL_SUBTEST_6( triangular_square(MatrixXcd(17,17)) ); - CALL_SUBTEST_7( triangular_square(Matrix(5, 5)) ); + CALL_SUBTEST_7( triangular_square(Matrix(r, r)) ); CALL_SUBTEST_8( triangular_rect(Matrix()) ); CALL_SUBTEST_9( triangular_rect(Matrix()) ); CALL_SUBTEST_4( triangular_rect(MatrixXcf(4, 10)) ); CALL_SUBTEST_6( triangular_rect(MatrixXcd(11, 3)) ); - CALL_SUBTEST_7( triangular_rect(Matrix(7, 6)) ); - + CALL_SUBTEST_7( triangular_rect(Matrix(r, c)) ); } } -- cgit v1.2.3