mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-12 14:25:16 +08:00
extend product unit tests
This commit is contained in:
parent
e38fc9692d
commit
55495dcbae
@ -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))) );
|
||||
}
|
||||
}
|
||||
|
@ -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_2( product_notemporary(MatrixXcd(s,s)) );
|
||||
CALL_SUBTEST_3( product_notemporary(MatrixXcf(s,s)) );
|
||||
s = ei_random<int>(16,120);
|
||||
CALL_SUBTEST_4( product_notemporary(MatrixXcd(s,s)) );
|
||||
}
|
||||
}
|
||||
|
@ -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)) );
|
||||
}
|
||||
}
|
||||
|
@ -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)) ));
|
||||
}
|
||||
}
|
||||
|
@ -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)) );
|
||||
}
|
||||
}
|
||||
|
@ -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))));
|
||||
}
|
||||
}
|
||||
|
@ -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)) );
|
||||
}
|
||||
}
|
||||
|
@ -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>()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user