diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-07-07 10:50:40 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-07-07 10:50:40 +0200 |
commit | 55495dcbaefbd25d8d97a260ca2de921357a137c (patch) | |
tree | 473b876abd4fbaab202cfec686a8d5cdc945d467 | |
parent | e38fc9692dfac3596331c6f7b9e50a0fb7dbcfe9 (diff) |
extend product unit tests
-rw-r--r-- | test/product_extra.cpp | 7 | ||||
-rw-r--r-- | test/product_notemporary.cpp | 6 | ||||
-rw-r--r-- | test/product_selfadjoint.cpp | 14 | ||||
-rw-r--r-- | test/product_symm.cpp | 10 | ||||
-rw-r--r-- | test/product_syrk.cpp | 6 | ||||
-rw-r--r-- | test/product_trmm.cpp | 4 | ||||
-rw-r--r-- | test/product_trmv.cpp | 10 | ||||
-rw-r--r-- | 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<typename MatrixType> 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<int>(2,320), ei_random<int>(2,320))) ); - CALL_SUBTEST_2( product_extra(MatrixXcf(ei_random<int>(2,50), ei_random<int>(2,50))) ); - CALL_SUBTEST_3( product_extra(Matrix<std::complex<double>,Dynamic,Dynamic,RowMajor>(ei_random<int>(2,50), ei_random<int>(2,50))) ); + CALL_SUBTEST_1( product_extra(MatrixXf(ei_random<int>(1,320), ei_random<int>(1,320))) ); + CALL_SUBTEST_2( product_extra(MatrixXd(ei_random<int>(1,320), ei_random<int>(1,320))) ); + CALL_SUBTEST_3( product_extra(MatrixXcf(ei_random<int>(1,150), ei_random<int>(1,150))) ); + CALL_SUBTEST_4( product_extra(MatrixXcd(ei_random<int>(1,150), ei_random<int>(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<int>(16,320); CALL_SUBTEST_1( product_notemporary(MatrixXf(s, s)) ); + s = ei_random<int>(16,320); + CALL_SUBTEST_2( product_notemporary(MatrixXd(s, s)) ); + s = ei_random<int>(16,120); + CALL_SUBTEST_3( product_notemporary(MatrixXcf(s,s)) ); s = ei_random<int>(16,120); - CALL_SUBTEST_2( product_notemporary(MatrixXcd(s,s)) ); + 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<typename MatrixType> 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<float, 1, 1>()) ); CALL_SUBTEST_2( product_selfadjoint(Matrix<float, 2, 2>()) ); 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<float,Dynamic,Dynamic,RowMajor>(17,17)) ); - CALL_SUBTEST_8( product_selfadjoint(Matrix<std::complex<double>,Dynamic,Dynamic,RowMajor>(19, 19)) ); + s = ei_random<int>(1,150); + CALL_SUBTEST_4( product_selfadjoint(MatrixXcf(s, s)) ); + s = ei_random<int>(1,150); + CALL_SUBTEST_5( product_selfadjoint(MatrixXcd(s,s)) ); + s = ei_random<int>(1,320); + CALL_SUBTEST_6( product_selfadjoint(MatrixXd(s,s)) ); + s = ei_random<int>(1,320); + CALL_SUBTEST_7( product_selfadjoint(Matrix<float,Dynamic,Dynamic,RowMajor>(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<float,Dynamic,Dynamic>(ei_random<int>(1,320),ei_random<int>(1,320)) )); CALL_SUBTEST_2(( symm<double,Dynamic,Dynamic>(ei_random<int>(1,320),ei_random<int>(1,320)) )); - CALL_SUBTEST_3(( symm<std::complex<double>,Dynamic,Dynamic>(ei_random<int>(1,320),ei_random<int>(1,320)) )); + CALL_SUBTEST_3(( symm<std::complex<float>,Dynamic,Dynamic>(ei_random<int>(1,200),ei_random<int>(1,200)) )); + CALL_SUBTEST_4(( symm<std::complex<double>,Dynamic,Dynamic>(ei_random<int>(1,200),ei_random<int>(1,200)) )); - CALL_SUBTEST_4(( symm<float,Dynamic,1>(ei_random<int>(1,320)) )); - CALL_SUBTEST_5(( symm<double,Dynamic,1>(ei_random<int>(1,320)) )); - CALL_SUBTEST_6(( symm<std::complex<double>,Dynamic,1>(ei_random<int>(1,320)) )); + CALL_SUBTEST_5(( symm<float,Dynamic,1>(ei_random<int>(1,320)) )); + CALL_SUBTEST_6(( symm<double,Dynamic,1>(ei_random<int>(1,320)) )); + CALL_SUBTEST_7(( symm<std::complex<float>,Dynamic,1>(ei_random<int>(1,320)) )); + CALL_SUBTEST_8(( symm<std::complex<double>,Dynamic,1>(ei_random<int>(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<int>(1,320); CALL_SUBTEST_2( syrk(MatrixXd(s, s)) ); - s = ei_random<int>(1,320); - CALL_SUBTEST_3( syrk(MatrixXcd(s, s)) ); + s = ei_random<int>(1,200); + CALL_SUBTEST_3( syrk(MatrixXcf(s, s)) ); + s = ei_random<int>(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<float>(ei_random<int>(1,320),ei_random<int>(1,320)))); - CALL_SUBTEST_2((trmm<std::complex<double> >(ei_random<int>(1,320),ei_random<int>(1,320)))); + CALL_SUBTEST_2((trmm<double>(ei_random<int>(1,320),ei_random<int>(1,320)))); + CALL_SUBTEST_3((trmm<std::complex<float> >(ei_random<int>(1,200),ei_random<int>(1,200)))); + CALL_SUBTEST_4((trmm<std::complex<double> >(ei_random<int>(1,200),ei_random<int>(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<typename MatrixType> void trmv(const MatrixType& m) void test_product_trmv() { + int s; for(int i = 0; i < g_repeat ; i++) { CALL_SUBTEST_1( trmv(Matrix<float, 1, 1>()) ); CALL_SUBTEST_2( trmv(Matrix<float, 2, 2>()) ); CALL_SUBTEST_3( trmv(Matrix3d()) ); - CALL_SUBTEST_4( trmv(Matrix<std::complex<float>,23, 23>()) ); - CALL_SUBTEST_5( trmv(MatrixXcd(17,17)) ); - CALL_SUBTEST_6( trmv(Matrix<float,Dynamic,Dynamic,RowMajor>(19, 19)) ); + s = ei_random<int>(1,200); + CALL_SUBTEST_4( trmv(MatrixXcf(s)) ); + s = ei_random<int>(1,200); + CALL_SUBTEST_5( trmv(MatrixXcd(s,s)) ); + s = ei_random<int>(1,320); + CALL_SUBTEST_6( trmv(Matrix<float,Dynamic,Dynamic,RowMajor>(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<float,Dynamic,Dynamic>(ei_random<int>(1,320),ei_random<int>(1,320)))); CALL_SUBTEST_2((trsolve<double,Dynamic,Dynamic>(ei_random<int>(1,320),ei_random<int>(1,320)))); - CALL_SUBTEST_3((trsolve<std::complex<double>,Dynamic,Dynamic>(ei_random<int>(1,320),ei_random<int>(1,320)))); + CALL_SUBTEST_3((trsolve<std::complex<float>,Dynamic,Dynamic>(ei_random<int>(1,200),ei_random<int>(1,200)))); + CALL_SUBTEST_4((trsolve<std::complex<double>,Dynamic,Dynamic>(ei_random<int>(1,200),ei_random<int>(1,200)))); // vectors - CALL_SUBTEST_4((trsolve<std::complex<double>,Dynamic,1>(ei_random<int>(1,320)))); - CALL_SUBTEST_5((trsolve<float,1,1>())); - CALL_SUBTEST_6((trsolve<float,1,2>())); - CALL_SUBTEST_7((trsolve<std::complex<float>,4,1>())); + CALL_SUBTEST_5((trsolve<std::complex<double>,Dynamic,1>(ei_random<int>(1,320)))); + CALL_SUBTEST_6((trsolve<float,1,1>())); + CALL_SUBTEST_7((trsolve<float,1,2>())); + CALL_SUBTEST_8((trsolve<std::complex<float>,4,1>())); } } |