From 62eb4dc99bb79a0e2015548c248d6270928533f1 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 2 Sep 2010 19:18:34 +0200 Subject: noalias was wrongly skipping automatic transposition --- test/basicstuff.cpp | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'test/basicstuff.cpp') diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 3e5626454..4ff4a24fa 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -31,6 +31,7 @@ template void basicStuff(const MatrixType& m) typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef Matrix VectorType; + typedef Matrix SquareMatrixType; Index rows = m.rows(); Index cols = m.cols(); @@ -47,6 +48,7 @@ template void basicStuff(const MatrixType& m) VectorType v1 = VectorType::Random(rows), v2 = VectorType::Random(rows), vzero = VectorType::Zero(rows); + SquareMatrixType sm1 = SquareMatrixType::Random(rows,rows), sm2(rows,rows); Scalar x = ei_random(); @@ -121,6 +123,27 @@ template void basicStuff(const MatrixType& m) m1 = m2; VERIFY(m1==m2); VERIFY(!(m1!=m2)); + + // check automatic transposition + sm2.setZero(); + for(typename MatrixType::Index i=0;i void basicStuffComplex(const MatrixType& m) @@ -177,14 +200,14 @@ void test_basicstuff() for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( basicStuff(Matrix()) ); CALL_SUBTEST_2( basicStuff(Matrix4d()) ); - CALL_SUBTEST_3( basicStuff(MatrixXcf(3, 3)) ); - CALL_SUBTEST_4( basicStuff(MatrixXi(8, 12)) ); - CALL_SUBTEST_5( basicStuff(MatrixXcd(20, 20)) ); + CALL_SUBTEST_3( basicStuff(MatrixXcf(ei_random(1,100), ei_random(1,100))) ); + CALL_SUBTEST_4( basicStuff(MatrixXi(ei_random(1,100), ei_random(1,100))) ); + CALL_SUBTEST_5( basicStuff(MatrixXcd(ei_random(1,100), ei_random(1,100))) ); CALL_SUBTEST_6( basicStuff(Matrix()) ); - CALL_SUBTEST_7( basicStuff(Matrix(10,10)) ); + CALL_SUBTEST_7( basicStuff(Matrix(ei_random(1,100),ei_random(1,100))) ); - CALL_SUBTEST_3( basicStuffComplex(MatrixXcf(21, 17)) ); - CALL_SUBTEST_5( basicStuffComplex(MatrixXcd(2, 3)) ); + CALL_SUBTEST_3( basicStuffComplex(MatrixXcf(ei_random(1,100), ei_random(1,100))) ); + CALL_SUBTEST_5( basicStuffComplex(MatrixXcd(ei_random(1,100), ei_random(1,100))) ); } CALL_SUBTEST_2(casting()); -- cgit v1.2.3