From 55495dcbaefbd25d8d97a260ca2de921357a137c Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 7 Jul 2010 10:50:40 +0200 Subject: [PATCH] extend product unit tests --- test/product_extra.cpp | 7 ++++--- test/product_notemporary.cpp | 6 +++++- test/product_selfadjoint.cpp | 14 +++++++++----- test/product_symm.cpp | 10 ++++++---- test/product_syrk.cpp | 6 ++++-- test/product_trmm.cpp | 4 +++- test/product_trmv.cpp | 10 +++++++--- test/product_trsolve.cpp | 11 ++++++----- 8 files changed, 44 insertions(+), 24 deletions(-) diff --git a/test/product_extra.cpp b/test/product_extra.cpp index 39a43da21..1ee92c962 100644 --- a/test/product_extra.cpp +++ b/test/product_extra.cpp @@ -115,8 +115,9 @@ template void product_extra(const MatrixType& m) void test_product_extra() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST_1( product_extra(MatrixXf(ei_random(2,320), ei_random(2,320))) ); - CALL_SUBTEST_2( product_extra(MatrixXcf(ei_random(2,50), ei_random(2,50))) ); - CALL_SUBTEST_3( product_extra(Matrix,Dynamic,Dynamic,RowMajor>(ei_random(2,50), ei_random(2,50))) ); + CALL_SUBTEST_1( product_extra(MatrixXf(ei_random(1,320), ei_random(1,320))) ); + CALL_SUBTEST_2( product_extra(MatrixXd(ei_random(1,320), ei_random(1,320))) ); + CALL_SUBTEST_3( product_extra(MatrixXcf(ei_random(1,150), ei_random(1,150))) ); + CALL_SUBTEST_4( product_extra(MatrixXcd(ei_random(1,150), ei_random(1,150))) ); } } diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp index 88f0dbbcd..9175694ba 100644 --- a/test/product_notemporary.cpp +++ b/test/product_notemporary.cpp @@ -130,7 +130,11 @@ void test_product_notemporary() for(int i = 0; i < g_repeat; i++) { s = ei_random(16,320); CALL_SUBTEST_1( product_notemporary(MatrixXf(s, s)) ); + s = ei_random(16,320); + CALL_SUBTEST_2( product_notemporary(MatrixXd(s, s)) ); s = ei_random(16,120); - CALL_SUBTEST_2( product_notemporary(MatrixXcd(s,s)) ); + CALL_SUBTEST_3( product_notemporary(MatrixXcf(s,s)) ); + s = ei_random(16,120); + CALL_SUBTEST_4( product_notemporary(MatrixXcd(s,s)) ); } } diff --git a/test/product_selfadjoint.cpp b/test/product_selfadjoint.cpp index d77cab37b..c84582484 100644 --- a/test/product_selfadjoint.cpp +++ b/test/product_selfadjoint.cpp @@ -78,14 +78,18 @@ template void product_selfadjoint(const MatrixType& m) void test_product_selfadjoint() { + int s; for(int i = 0; i < g_repeat ; i++) { CALL_SUBTEST_1( product_selfadjoint(Matrix()) ); CALL_SUBTEST_2( product_selfadjoint(Matrix()) ); CALL_SUBTEST_3( product_selfadjoint(Matrix3d()) ); - CALL_SUBTEST_4( product_selfadjoint(MatrixXcf(4, 4)) ); - CALL_SUBTEST_5( product_selfadjoint(MatrixXcd(21,21)) ); - CALL_SUBTEST_6( product_selfadjoint(MatrixXd(14,14)) ); - CALL_SUBTEST_7( product_selfadjoint(Matrix(17,17)) ); - CALL_SUBTEST_8( product_selfadjoint(Matrix,Dynamic,Dynamic,RowMajor>(19, 19)) ); + s = ei_random(1,150); + CALL_SUBTEST_4( product_selfadjoint(MatrixXcf(s, s)) ); + s = ei_random(1,150); + CALL_SUBTEST_5( product_selfadjoint(MatrixXcd(s,s)) ); + s = ei_random(1,320); + CALL_SUBTEST_6( product_selfadjoint(MatrixXd(s,s)) ); + s = ei_random(1,320); + CALL_SUBTEST_7( product_selfadjoint(Matrix(s,s)) ); } } diff --git a/test/product_symm.cpp b/test/product_symm.cpp index ed32fe5e2..5064237ab 100644 --- a/test/product_symm.cpp +++ b/test/product_symm.cpp @@ -116,10 +116,12 @@ void test_product_symm() { CALL_SUBTEST_1(( symm(ei_random(1,320),ei_random(1,320)) )); CALL_SUBTEST_2(( symm(ei_random(1,320),ei_random(1,320)) )); - CALL_SUBTEST_3(( symm,Dynamic,Dynamic>(ei_random(1,320),ei_random(1,320)) )); + CALL_SUBTEST_3(( symm,Dynamic,Dynamic>(ei_random(1,200),ei_random(1,200)) )); + CALL_SUBTEST_4(( symm,Dynamic,Dynamic>(ei_random(1,200),ei_random(1,200)) )); - CALL_SUBTEST_4(( symm(ei_random(1,320)) )); - CALL_SUBTEST_5(( symm(ei_random(1,320)) )); - CALL_SUBTEST_6(( symm,Dynamic,1>(ei_random(1,320)) )); + CALL_SUBTEST_5(( symm(ei_random(1,320)) )); + CALL_SUBTEST_6(( symm(ei_random(1,320)) )); + CALL_SUBTEST_7(( symm,Dynamic,1>(ei_random(1,320)) )); + CALL_SUBTEST_8(( symm,Dynamic,1>(ei_random(1,320)) )); } } diff --git a/test/product_syrk.cpp b/test/product_syrk.cpp index 83e874541..575b21cac 100644 --- a/test/product_syrk.cpp +++ b/test/product_syrk.cpp @@ -79,7 +79,9 @@ void test_product_syrk() CALL_SUBTEST_1( syrk(MatrixXf(s, s)) ); s = ei_random(1,320); CALL_SUBTEST_2( syrk(MatrixXd(s, s)) ); - s = ei_random(1,320); - CALL_SUBTEST_3( syrk(MatrixXcd(s, s)) ); + s = ei_random(1,200); + CALL_SUBTEST_3( syrk(MatrixXcf(s, s)) ); + s = ei_random(1,200); + CALL_SUBTEST_4( syrk(MatrixXcd(s, s)) ); } } diff --git a/test/product_trmm.cpp b/test/product_trmm.cpp index d3e91a86f..e20b408c4 100644 --- a/test/product_trmm.cpp +++ b/test/product_trmm.cpp @@ -79,6 +79,8 @@ void test_product_trmm() for(int i = 0; i < g_repeat ; i++) { CALL_SUBTEST_1((trmm(ei_random(1,320),ei_random(1,320)))); - CALL_SUBTEST_2((trmm >(ei_random(1,320),ei_random(1,320)))); + CALL_SUBTEST_2((trmm(ei_random(1,320),ei_random(1,320)))); + CALL_SUBTEST_3((trmm >(ei_random(1,200),ei_random(1,200)))); + CALL_SUBTEST_4((trmm >(ei_random(1,200),ei_random(1,200)))); } } diff --git a/test/product_trmv.cpp b/test/product_trmv.cpp index 33a4068cb..9ce09e429 100644 --- a/test/product_trmv.cpp +++ b/test/product_trmv.cpp @@ -88,12 +88,16 @@ template void trmv(const MatrixType& m) void test_product_trmv() { + int s; for(int i = 0; i < g_repeat ; i++) { CALL_SUBTEST_1( trmv(Matrix()) ); CALL_SUBTEST_2( trmv(Matrix()) ); CALL_SUBTEST_3( trmv(Matrix3d()) ); - CALL_SUBTEST_4( trmv(Matrix,23, 23>()) ); - CALL_SUBTEST_5( trmv(MatrixXcd(17,17)) ); - CALL_SUBTEST_6( trmv(Matrix(19, 19)) ); + s = ei_random(1,200); + CALL_SUBTEST_4( trmv(MatrixXcf(s)) ); + s = ei_random(1,200); + CALL_SUBTEST_5( trmv(MatrixXcd(s,s)) ); + s = ei_random(1,320); + CALL_SUBTEST_6( trmv(Matrix(s, s)) ); } } diff --git a/test/product_trsolve.cpp b/test/product_trsolve.cpp index c38e9af5d..b4b53a86f 100644 --- a/test/product_trsolve.cpp +++ b/test/product_trsolve.cpp @@ -81,12 +81,13 @@ void test_product_trsolve() // matrices CALL_SUBTEST_1((trsolve(ei_random(1,320),ei_random(1,320)))); CALL_SUBTEST_2((trsolve(ei_random(1,320),ei_random(1,320)))); - CALL_SUBTEST_3((trsolve,Dynamic,Dynamic>(ei_random(1,320),ei_random(1,320)))); + CALL_SUBTEST_3((trsolve,Dynamic,Dynamic>(ei_random(1,200),ei_random(1,200)))); + CALL_SUBTEST_4((trsolve,Dynamic,Dynamic>(ei_random(1,200),ei_random(1,200)))); // vectors - CALL_SUBTEST_4((trsolve,Dynamic,1>(ei_random(1,320)))); - CALL_SUBTEST_5((trsolve())); - CALL_SUBTEST_6((trsolve())); - CALL_SUBTEST_7((trsolve,4,1>())); + CALL_SUBTEST_5((trsolve,Dynamic,1>(ei_random(1,320)))); + CALL_SUBTEST_6((trsolve())); + CALL_SUBTEST_7((trsolve())); + CALL_SUBTEST_8((trsolve,4,1>())); } }