eigen2: split tests

This commit is contained in:
Benoit Jacob 2011-01-25 09:02:59 -05:00
parent b04591fbb4
commit 3e2469f951
38 changed files with 365 additions and 253 deletions

View File

@ -103,14 +103,14 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
void test_eigen2_adjoint() void test_eigen2_adjoint()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( adjoint(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( adjoint(Matrix<float, 1, 1>()) );
CALL_SUBTEST( adjoint(Matrix3d()) ); CALL_SUBTEST_2( adjoint(Matrix3d()) );
CALL_SUBTEST( adjoint(Matrix4f()) ); CALL_SUBTEST_3( adjoint(Matrix4f()) );
CALL_SUBTEST( adjoint(MatrixXcf(4, 4)) ); CALL_SUBTEST_4( adjoint(MatrixXcf(4, 4)) );
CALL_SUBTEST( adjoint(MatrixXi(8, 12)) ); CALL_SUBTEST_5( adjoint(MatrixXi(8, 12)) );
CALL_SUBTEST( adjoint(MatrixXf(21, 21)) ); CALL_SUBTEST_6( adjoint(MatrixXf(21, 21)) );
} }
// test a large matrix only once // test a large matrix only once
CALL_SUBTEST( adjoint(Matrix<float, 100, 100>()) ); CALL_SUBTEST_7( adjoint(Matrix<float, 100, 100>()) );
} }

View File

@ -68,8 +68,8 @@ template<typename BoxType> void alignedbox(const BoxType& _box)
void test_eigen2_alignedbox() void test_eigen2_alignedbox()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( alignedbox(AlignedBox<float,2>()) ); CALL_SUBTEST_1( alignedbox(AlignedBox<float,2>()) );
CALL_SUBTEST( alignedbox(AlignedBox<float,3>()) ); CALL_SUBTEST_2( alignedbox(AlignedBox<float,3>()) );
CALL_SUBTEST( alignedbox(AlignedBox<double,4>()) ); CALL_SUBTEST_3( alignedbox(AlignedBox<double,4>()) );
} }
} }

View File

@ -132,26 +132,26 @@ template<typename VectorType> void lpNorm(const VectorType& v)
void test_eigen2_array() void test_eigen2_array()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( array(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( array(Matrix<float, 1, 1>()) );
CALL_SUBTEST( array(Matrix2f()) ); CALL_SUBTEST_2( array(Matrix2f()) );
CALL_SUBTEST( array(Matrix4d()) ); CALL_SUBTEST_3( array(Matrix4d()) );
CALL_SUBTEST( array(MatrixXcf(3, 3)) ); CALL_SUBTEST_4( array(MatrixXcf(3, 3)) );
CALL_SUBTEST( array(MatrixXf(8, 12)) ); CALL_SUBTEST_5( array(MatrixXf(8, 12)) );
CALL_SUBTEST( array(MatrixXi(8, 12)) ); CALL_SUBTEST_6( array(MatrixXi(8, 12)) );
} }
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( comparisons(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( comparisons(Matrix<float, 1, 1>()) );
CALL_SUBTEST( comparisons(Matrix2f()) ); CALL_SUBTEST_2( comparisons(Matrix2f()) );
CALL_SUBTEST( comparisons(Matrix4d()) ); CALL_SUBTEST_3( comparisons(Matrix4d()) );
CALL_SUBTEST( comparisons(MatrixXf(8, 12)) ); CALL_SUBTEST_5( comparisons(MatrixXf(8, 12)) );
CALL_SUBTEST( comparisons(MatrixXi(8, 12)) ); CALL_SUBTEST_6( comparisons(MatrixXi(8, 12)) );
} }
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( lpNorm(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( lpNorm(Matrix<float, 1, 1>()) );
CALL_SUBTEST( lpNorm(Vector2f()) ); CALL_SUBTEST_2( lpNorm(Vector2f()) );
CALL_SUBTEST( lpNorm(Vector3d()) ); CALL_SUBTEST_3( lpNorm(Vector3d()) );
CALL_SUBTEST( lpNorm(Vector4f()) ); CALL_SUBTEST_4( lpNorm(Vector4f()) );
CALL_SUBTEST( lpNorm(VectorXf(16)) ); CALL_SUBTEST_5( lpNorm(VectorXf(16)) );
CALL_SUBTEST( lpNorm(VectorXcd(10)) ); CALL_SUBTEST_7( lpNorm(VectorXcd(10)) );
} }
} }

View File

@ -112,12 +112,12 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
void test_eigen2_basicstuff() void test_eigen2_basicstuff()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( basicStuff(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( basicStuff(Matrix<float, 1, 1>()) );
CALL_SUBTEST( basicStuff(Matrix4d()) ); CALL_SUBTEST_2( basicStuff(Matrix4d()) );
CALL_SUBTEST( basicStuff(MatrixXcf(3, 3)) ); CALL_SUBTEST_3( basicStuff(MatrixXcf(3, 3)) );
CALL_SUBTEST( basicStuff(MatrixXi(8, 12)) ); CALL_SUBTEST_4( basicStuff(MatrixXi(8, 12)) );
CALL_SUBTEST( basicStuff(MatrixXcd(20, 20)) ); CALL_SUBTEST_5( basicStuff(MatrixXcd(20, 20)) );
CALL_SUBTEST( basicStuff(Matrix<float, 100, 100>()) ); CALL_SUBTEST_6( basicStuff(Matrix<float, 100, 100>()) );
CALL_SUBTEST( basicStuff(Matrix<long double,Dynamic,Dynamic>(10,10)) ); CALL_SUBTEST_7( basicStuff(Matrix<long double,Dynamic,Dynamic>(10,10)) );
} }
} }

View File

@ -116,16 +116,18 @@ template<typename MatrixType> void cholesky(const MatrixType& m)
void test_eigen2_cholesky() void test_eigen2_cholesky()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( cholesky(Matrix<double,1,1>()) ); CALL_SUBTEST_1( cholesky(Matrix<double,1,1>()) );
CALL_SUBTEST( cholesky(Matrix2d()) ); CALL_SUBTEST_2( cholesky(Matrix2d()) );
CALL_SUBTEST( cholesky(Matrix3f()) ); CALL_SUBTEST_3( cholesky(Matrix3f()) );
CALL_SUBTEST( cholesky(Matrix4d()) ); CALL_SUBTEST_4( cholesky(Matrix4d()) );
CALL_SUBTEST( cholesky(MatrixXcd(7,7)) ); CALL_SUBTEST_5( cholesky(MatrixXcd(7,7)) );
CALL_SUBTEST( cholesky(MatrixXf(17,17)) ); CALL_SUBTEST_6( cholesky(MatrixXf(17,17)) );
CALL_SUBTEST( cholesky(MatrixXd(33,33)) ); CALL_SUBTEST_7( cholesky(MatrixXd(33,33)) );
} }
#ifdef EIGEN_TEST_PART_6
MatrixXf m = MatrixXf::Zero(10,10); MatrixXf m = MatrixXf::Zero(10,10);
VectorXf b = VectorXf::Zero(10); VectorXf b = VectorXf::Zero(10);
VERIFY(!m.llt().isPositiveDefinite()); VERIFY(!m.llt().isPositiveDefinite());
#endif
} }

View File

@ -163,11 +163,11 @@ template<typename MatrixType> void cwiseops(const MatrixType& m)
void test_eigen2_cwiseop() void test_eigen2_cwiseop()
{ {
for(int i = 0; i < g_repeat ; i++) { for(int i = 0; i < g_repeat ; i++) {
CALL_SUBTEST( cwiseops(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( cwiseops(Matrix<float, 1, 1>()) );
CALL_SUBTEST( cwiseops(Matrix4d()) ); CALL_SUBTEST_2( cwiseops(Matrix4d()) );
CALL_SUBTEST( cwiseops(MatrixXf(3, 3)) ); CALL_SUBTEST_3( cwiseops(MatrixXf(3, 3)) );
CALL_SUBTEST( cwiseops(MatrixXf(22, 22)) ); CALL_SUBTEST_3( cwiseops(MatrixXf(22, 22)) );
CALL_SUBTEST( cwiseops(MatrixXi(8, 12)) ); CALL_SUBTEST_4( cwiseops(MatrixXi(8, 12)) );
CALL_SUBTEST( cwiseops(MatrixXd(20, 20)) ); CALL_SUBTEST_5( cwiseops(MatrixXd(20, 20)) );
} }
} }

View File

@ -65,12 +65,12 @@ template<typename MatrixType> void determinant(const MatrixType& m)
void test_eigen2_determinant() void test_eigen2_determinant()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( determinant(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( determinant(Matrix<float, 1, 1>()) );
CALL_SUBTEST( determinant(Matrix<double, 2, 2>()) ); CALL_SUBTEST_2( determinant(Matrix<double, 2, 2>()) );
CALL_SUBTEST( determinant(Matrix<double, 3, 3>()) ); CALL_SUBTEST_3( determinant(Matrix<double, 3, 3>()) );
CALL_SUBTEST( determinant(Matrix<double, 4, 4>()) ); CALL_SUBTEST_4( determinant(Matrix<double, 4, 4>()) );
CALL_SUBTEST( determinant(Matrix<std::complex<double>, 10, 10>()) ); CALL_SUBTEST_5( determinant(Matrix<std::complex<double>, 10, 10>()) );
CALL_SUBTEST( determinant(MatrixXd(20, 20)) ); CALL_SUBTEST_6( determinant(MatrixXd(20, 20)) );
} }
CALL_SUBTEST( determinant(MatrixXd(200, 200)) ); CALL_SUBTEST_6( determinant(MatrixXd(200, 200)) );
} }

View File

@ -149,14 +149,14 @@ void test_eigen2_eigensolver()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
// very important to test a 3x3 matrix since we provide a special path for it // very important to test a 3x3 matrix since we provide a special path for it
CALL_SUBTEST( selfadjointeigensolver(Matrix3f()) ); CALL_SUBTEST_1( selfadjointeigensolver(Matrix3f()) );
CALL_SUBTEST( selfadjointeigensolver(Matrix4d()) ); CALL_SUBTEST_2( selfadjointeigensolver(Matrix4d()) );
CALL_SUBTEST( selfadjointeigensolver(MatrixXf(7,7)) ); CALL_SUBTEST_3( selfadjointeigensolver(MatrixXf(7,7)) );
CALL_SUBTEST( selfadjointeigensolver(MatrixXcd(5,5)) ); CALL_SUBTEST_4( selfadjointeigensolver(MatrixXcd(5,5)) );
CALL_SUBTEST( selfadjointeigensolver(MatrixXd(19,19)) ); CALL_SUBTEST_5( selfadjointeigensolver(MatrixXd(19,19)) );
CALL_SUBTEST( eigensolver(Matrix4f()) ); CALL_SUBTEST_6( eigensolver(Matrix4f()) );
CALL_SUBTEST( eigensolver(MatrixXd(17,17)) ); CALL_SUBTEST_5( eigensolver(MatrixXd(17,17)) );
} }
} }

View File

@ -440,7 +440,7 @@ template<typename Scalar> void geometry(void)
void test_eigen2_geometry() void test_eigen2_geometry()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( geometry<float>() ); CALL_SUBTEST_1( geometry<float>() );
CALL_SUBTEST( geometry<double>() ); CALL_SUBTEST_2( geometry<double>() );
} }
} }

View File

@ -131,11 +131,11 @@ template<typename Scalar> void lines()
void test_eigen2_hyperplane() void test_eigen2_hyperplane()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( hyperplane(Hyperplane<float,2>()) ); CALL_SUBTEST_1( hyperplane(Hyperplane<float,2>()) );
CALL_SUBTEST( hyperplane(Hyperplane<float,3>()) ); CALL_SUBTEST_2( hyperplane(Hyperplane<float,3>()) );
CALL_SUBTEST( hyperplane(Hyperplane<double,4>()) ); CALL_SUBTEST_3( hyperplane(Hyperplane<double,4>()) );
CALL_SUBTEST( hyperplane(Hyperplane<std::complex<double>,5>()) ); CALL_SUBTEST_4( hyperplane(Hyperplane<std::complex<double>,5>()) );
CALL_SUBTEST( lines<float>() ); CALL_SUBTEST_5( lines<float>() );
CALL_SUBTEST( lines<double>() ); CALL_SUBTEST_6( lines<double>() );
} }
} }

View File

@ -68,11 +68,11 @@ template<typename MatrixType> void inverse(const MatrixType& m)
void test_eigen2_inverse() void test_eigen2_inverse()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( inverse(Matrix<double,1,1>()) ); CALL_SUBTEST_1( inverse(Matrix<double,1,1>()) );
CALL_SUBTEST( inverse(Matrix2d()) ); CALL_SUBTEST_2( inverse(Matrix2d()) );
CALL_SUBTEST( inverse(Matrix3f()) ); CALL_SUBTEST_3( inverse(Matrix3f()) );
CALL_SUBTEST( inverse(Matrix4f()) ); CALL_SUBTEST_4( inverse(Matrix4f()) );
CALL_SUBTEST( inverse(MatrixXf(8,8)) ); CALL_SUBTEST_5( inverse(MatrixXf(8,8)) );
CALL_SUBTEST( inverse(MatrixXcd(7,7)) ); CALL_SUBTEST_6( inverse(MatrixXcd(7,7)) );
} }
} }

View File

@ -87,13 +87,13 @@ template<typename MatrixType> void linearStructure(const MatrixType& m)
void test_eigen2_linearstructure() void test_eigen2_linearstructure()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( linearStructure(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( linearStructure(Matrix<float, 1, 1>()) );
CALL_SUBTEST( linearStructure(Matrix2f()) ); CALL_SUBTEST_2( linearStructure(Matrix2f()) );
CALL_SUBTEST( linearStructure(Vector3d()) ); CALL_SUBTEST_3( linearStructure(Vector3d()) );
CALL_SUBTEST( linearStructure(Matrix4d()) ); CALL_SUBTEST_4( linearStructure(Matrix4d()) );
CALL_SUBTEST( linearStructure(MatrixXcf(3, 3)) ); CALL_SUBTEST_5( linearStructure(MatrixXcf(3, 3)) );
CALL_SUBTEST( linearStructure(MatrixXf(8, 12)) ); CALL_SUBTEST_6( linearStructure(MatrixXf(8, 12)) );
CALL_SUBTEST( linearStructure(MatrixXi(8, 12)) ); CALL_SUBTEST_7( linearStructure(MatrixXi(8, 12)) );
CALL_SUBTEST( linearStructure(MatrixXcd(20, 20)) ); CALL_SUBTEST_8( linearStructure(MatrixXcd(20, 20)) );
} }
} }

View File

@ -123,19 +123,21 @@ template<typename MatrixType> void lu_invertible()
void test_eigen2_lu() void test_eigen2_lu()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( lu_non_invertible<MatrixXf>() ); CALL_SUBTEST_1( lu_non_invertible<MatrixXf>() );
CALL_SUBTEST( lu_non_invertible<MatrixXd>() ); CALL_SUBTEST_2( lu_non_invertible<MatrixXd>() );
CALL_SUBTEST( lu_non_invertible<MatrixXcf>() ); CALL_SUBTEST_3( lu_non_invertible<MatrixXcf>() );
CALL_SUBTEST( lu_non_invertible<MatrixXcd>() ); CALL_SUBTEST_4( lu_non_invertible<MatrixXcd>() );
CALL_SUBTEST( lu_invertible<MatrixXf>() ); CALL_SUBTEST_1( lu_invertible<MatrixXf>() );
CALL_SUBTEST( lu_invertible<MatrixXd>() ); CALL_SUBTEST_2( lu_invertible<MatrixXd>() );
CALL_SUBTEST( lu_invertible<MatrixXcf>() ); CALL_SUBTEST_3( lu_invertible<MatrixXcf>() );
CALL_SUBTEST( lu_invertible<MatrixXcd>() ); CALL_SUBTEST_4( lu_invertible<MatrixXcd>() );
} }
#ifdef EIGEN_TEST_PART_1
MatrixXf m = MatrixXf::Zero(10,10); MatrixXf m = MatrixXf::Zero(10,10);
VectorXf b = VectorXf::Zero(10); VectorXf b = VectorXf::Zero(10);
VectorXf x = VectorXf::Random(10); VectorXf x = VectorXf::Random(10);
VERIFY(m.lu().solve(b,&x)); VERIFY(m.lu().solve(b,&x));
VERIFY(x.isZero()); VERIFY(x.isZero());
#endif
} }

View File

@ -108,22 +108,22 @@ template<typename VectorType> void map_static_methods(const VectorType& m)
void test_eigen2_map() void test_eigen2_map()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( map_class_vector(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( map_class_vector(Matrix<float, 1, 1>()) );
CALL_SUBTEST( map_class_vector(Vector4d()) ); CALL_SUBTEST_2( map_class_vector(Vector4d()) );
CALL_SUBTEST( map_class_vector(RowVector4f()) ); CALL_SUBTEST_3( map_class_vector(RowVector4f()) );
CALL_SUBTEST( map_class_vector(VectorXcf(8)) ); CALL_SUBTEST_4( map_class_vector(VectorXcf(8)) );
CALL_SUBTEST( map_class_vector(VectorXi(12)) ); CALL_SUBTEST_5( map_class_vector(VectorXi(12)) );
CALL_SUBTEST( map_class_matrix(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( map_class_matrix(Matrix<float, 1, 1>()) );
CALL_SUBTEST( map_class_matrix(Matrix4d()) ); CALL_SUBTEST_2( map_class_matrix(Matrix4d()) );
CALL_SUBTEST( map_class_matrix(Matrix<float,3,5>()) ); CALL_SUBTEST_6( map_class_matrix(Matrix<float,3,5>()) );
CALL_SUBTEST( map_class_matrix(MatrixXcf(ei_random<int>(1,10),ei_random<int>(1,10))) ); CALL_SUBTEST_4( map_class_matrix(MatrixXcf(ei_random<int>(1,10),ei_random<int>(1,10))) );
CALL_SUBTEST( map_class_matrix(MatrixXi(ei_random<int>(1,10),ei_random<int>(1,10))) ); CALL_SUBTEST_5( map_class_matrix(MatrixXi(ei_random<int>(1,10),ei_random<int>(1,10))) );
CALL_SUBTEST( map_static_methods(Matrix<double, 1, 1>()) ); CALL_SUBTEST_1( map_static_methods(Matrix<double, 1, 1>()) );
CALL_SUBTEST( map_static_methods(Vector3f()) ); CALL_SUBTEST_2( map_static_methods(Vector3f()) );
CALL_SUBTEST( map_static_methods(RowVector3d()) ); CALL_SUBTEST_7( map_static_methods(RowVector3d()) );
CALL_SUBTEST( map_static_methods(VectorXcd(8)) ); CALL_SUBTEST_4( map_static_methods(VectorXcd(8)) );
CALL_SUBTEST( map_static_methods(VectorXf(12)) ); CALL_SUBTEST_5( map_static_methods(VectorXf(12)) );
} }
} }

View File

@ -54,10 +54,10 @@ template<typename MatrixType> void miscMatrices(const MatrixType& m)
void test_eigen2_miscmatrices() void test_eigen2_miscmatrices()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( miscMatrices(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( miscMatrices(Matrix<float, 1, 1>()) );
CALL_SUBTEST( miscMatrices(Matrix4d()) ); CALL_SUBTEST_2( miscMatrices(Matrix4d()) );
CALL_SUBTEST( miscMatrices(MatrixXcf(3, 3)) ); CALL_SUBTEST_3( miscMatrices(MatrixXcf(3, 3)) );
CALL_SUBTEST( miscMatrices(MatrixXi(8, 12)) ); CALL_SUBTEST_4( miscMatrices(MatrixXi(8, 12)) );
CALL_SUBTEST( miscMatrices(MatrixXcd(20, 20)) ); CALL_SUBTEST_5( miscMatrices(MatrixXcd(20, 20)) );
} }
} }

View File

@ -82,7 +82,7 @@ template<int SizeAtCompileType> void mixingtypes(int size = SizeAtCompileType)
void test_eigen2_mixingtypes() void test_eigen2_mixingtypes()
{ {
// check that our operator new is indeed called: // check that our operator new is indeed called:
CALL_SUBTEST(mixingtypes<3>()); CALL_SUBTEST_1(mixingtypes<3>());
CALL_SUBTEST(mixingtypes<4>()); CALL_SUBTEST_2(mixingtypes<4>());
CALL_SUBTEST(mixingtypes<Dynamic>(20)); CALL_SUBTEST_3(mixingtypes<Dynamic>(20));
} }

View File

@ -136,29 +136,29 @@ void check_stdvector_quaternion(const QuaternionType&)
void test_eigen2_newstdvector() void test_eigen2_newstdvector()
{ {
// some non vectorizable fixed sizes // some non vectorizable fixed sizes
CALL_SUBTEST(check_stdvector_matrix(Vector2f())); CALL_SUBTEST_1(check_stdvector_matrix(Vector2f()));
CALL_SUBTEST(check_stdvector_matrix(Matrix3f())); CALL_SUBTEST_1(check_stdvector_matrix(Matrix3f()));
CALL_SUBTEST(check_stdvector_matrix(Matrix3d())); CALL_SUBTEST_1(check_stdvector_matrix(Matrix3d()));
// some vectorizable fixed sizes // some vectorizable fixed sizes
CALL_SUBTEST(check_stdvector_matrix(Matrix2f())); CALL_SUBTEST_2(check_stdvector_matrix(Matrix2f()));
CALL_SUBTEST(check_stdvector_matrix(Vector4f())); CALL_SUBTEST_2(check_stdvector_matrix(Vector4f()));
CALL_SUBTEST(check_stdvector_matrix(Matrix4f())); CALL_SUBTEST_2(check_stdvector_matrix(Matrix4f()));
CALL_SUBTEST(check_stdvector_matrix(Matrix4d())); CALL_SUBTEST_2(check_stdvector_matrix(Matrix4d()));
// some dynamic sizes // some dynamic sizes
CALL_SUBTEST(check_stdvector_matrix(MatrixXd(1,1))); CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1,1)));
CALL_SUBTEST(check_stdvector_matrix(VectorXd(20))); CALL_SUBTEST_3(check_stdvector_matrix(VectorXd(20)));
CALL_SUBTEST(check_stdvector_matrix(RowVectorXf(20))); CALL_SUBTEST_3(check_stdvector_matrix(RowVectorXf(20)));
CALL_SUBTEST(check_stdvector_matrix(MatrixXcf(10,10))); CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10,10)));
// some Transform // some Transform
CALL_SUBTEST(check_stdvector_transform(Transform2f())); CALL_SUBTEST_4(check_stdvector_transform(Transform2f()));
CALL_SUBTEST(check_stdvector_transform(Transform3f())); CALL_SUBTEST_4(check_stdvector_transform(Transform3f()));
CALL_SUBTEST(check_stdvector_transform(Transform3d())); CALL_SUBTEST_4(check_stdvector_transform(Transform3d()));
//CALL_SUBTEST(check_stdvector_transform(Transform4d())); //CALL_SUBTEST(check_stdvector_transform(Transform4d()));
// some Quaternion // some Quaternion
CALL_SUBTEST(check_stdvector_quaternion(Quaternionf())); CALL_SUBTEST_5(check_stdvector_quaternion(Quaternionf()));
CALL_SUBTEST(check_stdvector_quaternion(Quaterniond())); CALL_SUBTEST_5(check_stdvector_quaternion(Quaterniond()));
} }

View File

@ -72,7 +72,7 @@ void test_eigen2_nomalloc()
{ {
// check that our operator new is indeed called: // check that our operator new is indeed called:
VERIFY_RAISES_ASSERT(MatrixXd dummy = MatrixXd::Random(3,3)); VERIFY_RAISES_ASSERT(MatrixXd dummy = MatrixXd::Random(3,3));
CALL_SUBTEST( nomalloc(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( nomalloc(Matrix<float, 1, 1>()) );
CALL_SUBTEST( nomalloc(Matrix4d()) ); CALL_SUBTEST_2( nomalloc(Matrix4d()) );
CALL_SUBTEST( nomalloc(Matrix<float,32,32>()) ); CALL_SUBTEST_3( nomalloc(Matrix<float,32,32>()) );
} }

View File

@ -139,9 +139,9 @@ template<typename Scalar> void packetmath()
void test_eigen2_packetmath() void test_eigen2_packetmath()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( packetmath<float>() ); CALL_SUBTEST_1( packetmath<float>() );
CALL_SUBTEST( packetmath<double>() ); CALL_SUBTEST_2( packetmath<double>() );
CALL_SUBTEST( packetmath<int>() ); CALL_SUBTEST_3( packetmath<int>() );
CALL_SUBTEST( packetmath<std::complex<float> >() ); CALL_SUBTEST_4( packetmath<std::complex<float> >() );
} }
} }

View File

@ -69,9 +69,9 @@ template<typename LineType> void parametrizedline(const LineType& _line)
void test_eigen2_parametrizedline() void test_eigen2_parametrizedline()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( parametrizedline(ParametrizedLine<float,2>()) ); CALL_SUBTEST_1( parametrizedline(ParametrizedLine<float,2>()) );
CALL_SUBTEST( parametrizedline(ParametrizedLine<float,3>()) ); CALL_SUBTEST_2( parametrizedline(ParametrizedLine<float,3>()) );
CALL_SUBTEST( parametrizedline(ParametrizedLine<double,4>()) ); CALL_SUBTEST_3( parametrizedline(ParametrizedLine<double,4>()) );
CALL_SUBTEST( parametrizedline(ParametrizedLine<std::complex<double>,5>()) ); CALL_SUBTEST_4( parametrizedline(ParametrizedLine<std::complex<double>,5>()) );
} }
} }

View File

@ -88,12 +88,12 @@ template<typename MatrixType> void inverse_general_4x4(int repeat)
void test_eigen2_prec_inverse_4x4() void test_eigen2_prec_inverse_4x4()
{ {
CALL_SUBTEST((inverse_permutation_4x4<Matrix4f>())); CALL_SUBTEST_1((inverse_permutation_4x4<Matrix4f>()));
CALL_SUBTEST(( inverse_general_4x4<Matrix4f>(200000 * g_repeat) )); CALL_SUBTEST_1(( inverse_general_4x4<Matrix4f>(200000 * g_repeat) ));
CALL_SUBTEST((inverse_permutation_4x4<Matrix<double,4,4,RowMajor> >())); CALL_SUBTEST_2((inverse_permutation_4x4<Matrix<double,4,4,RowMajor> >()));
CALL_SUBTEST(( inverse_general_4x4<Matrix<double,4,4,RowMajor> >(200000 * g_repeat) )); CALL_SUBTEST_2(( inverse_general_4x4<Matrix<double,4,4,RowMajor> >(200000 * g_repeat) ));
CALL_SUBTEST((inverse_permutation_4x4<Matrix4cf>())); CALL_SUBTEST_3((inverse_permutation_4x4<Matrix4cf>()));
CALL_SUBTEST((inverse_general_4x4<Matrix4cf>(50000 * g_repeat))); CALL_SUBTEST_3((inverse_general_4x4<Matrix4cf>(50000 * g_repeat)));
} }

View File

@ -27,13 +27,14 @@
void test_eigen2_product_large() void test_eigen2_product_large()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( product(MatrixXf(ei_random<int>(1,320), ei_random<int>(1,320))) ); CALL_SUBTEST_1( product(MatrixXf(ei_random<int>(1,320), ei_random<int>(1,320))) );
CALL_SUBTEST( product(MatrixXd(ei_random<int>(1,320), ei_random<int>(1,320))) ); CALL_SUBTEST_2( product(MatrixXd(ei_random<int>(1,320), ei_random<int>(1,320))) );
CALL_SUBTEST( product(MatrixXi(ei_random<int>(1,320), ei_random<int>(1,320))) ); CALL_SUBTEST_3( product(MatrixXi(ei_random<int>(1,320), ei_random<int>(1,320))) );
CALL_SUBTEST( product(MatrixXcf(ei_random<int>(1,50), ei_random<int>(1,50))) ); CALL_SUBTEST_4( product(MatrixXcf(ei_random<int>(1,50), ei_random<int>(1,50))) );
CALL_SUBTEST( product(Matrix<float,Dynamic,Dynamic,RowMajor>(ei_random<int>(1,320), ei_random<int>(1,320))) ); CALL_SUBTEST_5( product(Matrix<float,Dynamic,Dynamic,RowMajor>(ei_random<int>(1,320), ei_random<int>(1,320))) );
} }
#ifdef EIGEN_TEST_PART_6
{ {
// test a specific issue in DiagonalProduct // test a specific issue in DiagonalProduct
int N = 1000000; int N = 1000000;
@ -55,4 +56,5 @@ void test_eigen2_product_large()
MatrixXf result = mat1.row(2)*mat2.transpose(); MatrixXf result = mat1.row(2)*mat2.transpose();
VERIFY_IS_APPROX(result, (mat1.row(2)*mat2.transpose()).eval()); VERIFY_IS_APPROX(result, (mat1.row(2)*mat2.transpose()).eval());
} }
#endif
} }

View File

@ -28,10 +28,10 @@
void test_eigen2_product_small() void test_eigen2_product_small()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( product(Matrix<float, 3, 2>()) ); CALL_SUBTEST_1( product(Matrix<float, 3, 2>()) );
CALL_SUBTEST( product(Matrix<int, 3, 5>()) ); CALL_SUBTEST_2( product(Matrix<int, 3, 5>()) );
CALL_SUBTEST( product(Matrix3d()) ); CALL_SUBTEST_3( product(Matrix3d()) );
CALL_SUBTEST( product(Matrix4d()) ); CALL_SUBTEST_4( product(Matrix4d()) );
CALL_SUBTEST( product(Matrix4f()) ); CALL_SUBTEST_5( product(Matrix4f()) );
} }
} }

View File

@ -60,13 +60,14 @@ template<typename MatrixType> void qr(const MatrixType& m)
void test_eigen2_qr() void test_eigen2_qr()
{ {
for(int i = 0; i < 1; i++) { for(int i = 0; i < 1; i++) {
CALL_SUBTEST( qr(Matrix2f()) ); CALL_SUBTEST_1( qr(Matrix2f()) );
CALL_SUBTEST( qr(Matrix4d()) ); CALL_SUBTEST_2( qr(Matrix4d()) );
CALL_SUBTEST( qr(MatrixXf(12,8)) ); CALL_SUBTEST_3( qr(MatrixXf(12,8)) );
CALL_SUBTEST( qr(MatrixXcd(5,5)) ); CALL_SUBTEST_4( qr(MatrixXcd(5,5)) );
CALL_SUBTEST( qr(MatrixXcd(7,3)) ); CALL_SUBTEST_4( qr(MatrixXcd(7,3)) );
} }
#ifdef EIGEN_TEST_PART_5
// small isFullRank test // small isFullRank test
{ {
Matrix3d mat; Matrix3d mat;
@ -82,4 +83,6 @@ void test_eigen2_qr()
VERIFY(m.qr().solve(b,&x)); VERIFY(m.qr().solve(b,&x));
VERIFY(x.isZero()); VERIFY(x.isZero());
} }
#endif
} }

View File

@ -145,29 +145,29 @@ void check_qtvector_quaternion(const QuaternionType&)
void test_eigen2_qtvector() void test_eigen2_qtvector()
{ {
// some non vectorizable fixed sizes // some non vectorizable fixed sizes
CALL_SUBTEST(check_qtvector_matrix(Vector2f())); CALL_SUBTEST_1(check_qtvector_matrix(Vector2f()));
CALL_SUBTEST(check_qtvector_matrix(Matrix3f())); CALL_SUBTEST_1(check_qtvector_matrix(Matrix3f()));
CALL_SUBTEST(check_qtvector_matrix(Matrix3d())); CALL_SUBTEST_1(check_qtvector_matrix(Matrix3d()));
// some vectorizable fixed sizes // some vectorizable fixed sizes
CALL_SUBTEST(check_qtvector_matrix(Matrix2f())); CALL_SUBTEST_2(check_qtvector_matrix(Matrix2f()));
CALL_SUBTEST(check_qtvector_matrix(Vector4f())); CALL_SUBTEST_2(check_qtvector_matrix(Vector4f()));
CALL_SUBTEST(check_qtvector_matrix(Matrix4f())); CALL_SUBTEST_2(check_qtvector_matrix(Matrix4f()));
CALL_SUBTEST(check_qtvector_matrix(Matrix4d())); CALL_SUBTEST_2(check_qtvector_matrix(Matrix4d()));
// some dynamic sizes // some dynamic sizes
CALL_SUBTEST(check_qtvector_matrix(MatrixXd(1,1))); CALL_SUBTEST_3(check_qtvector_matrix(MatrixXd(1,1)));
CALL_SUBTEST(check_qtvector_matrix(VectorXd(20))); CALL_SUBTEST_3(check_qtvector_matrix(VectorXd(20)));
CALL_SUBTEST(check_qtvector_matrix(RowVectorXf(20))); CALL_SUBTEST_3(check_qtvector_matrix(RowVectorXf(20)));
CALL_SUBTEST(check_qtvector_matrix(MatrixXcf(10,10))); CALL_SUBTEST_3(check_qtvector_matrix(MatrixXcf(10,10)));
// some Transform // some Transform
CALL_SUBTEST(check_qtvector_transform(Transform2f())); CALL_SUBTEST_4(check_qtvector_transform(Transform2f()));
CALL_SUBTEST(check_qtvector_transform(Transform3f())); CALL_SUBTEST_4(check_qtvector_transform(Transform3f()));
CALL_SUBTEST(check_qtvector_transform(Transform3d())); CALL_SUBTEST_4(check_qtvector_transform(Transform3d()));
//CALL_SUBTEST(check_qtvector_transform(Transform4d())); //CALL_SUBTEST_4(check_qtvector_transform(Transform4d()));
// some Quaternion // some Quaternion
CALL_SUBTEST(check_qtvector_quaternion(Quaternionf())); CALL_SUBTEST_5(check_qtvector_quaternion(Quaternionf()));
CALL_SUBTEST(check_qtvector_quaternion(Quaternionf())); CALL_SUBTEST_5(check_qtvector_quaternion(Quaternionf()));
} }

View File

@ -95,6 +95,7 @@ void test_eigen2_regression()
{ {
for(int i = 0; i < g_repeat; i++) for(int i = 0; i < g_repeat; i++)
{ {
#ifdef EIGEN_TEST_PART_1
{ {
Vector2f points2f [1000]; Vector2f points2f [1000];
Vector2f *points2f_ptrs [1000]; Vector2f *points2f_ptrs [1000];
@ -108,7 +109,8 @@ void test_eigen2_regression()
CALL_SUBTEST(check_linearRegression(100, points2f_ptrs, coeffs2f, 0.01f)); CALL_SUBTEST(check_linearRegression(100, points2f_ptrs, coeffs2f, 0.01f));
CALL_SUBTEST(check_linearRegression(1000, points2f_ptrs, coeffs2f, 0.002f)); CALL_SUBTEST(check_linearRegression(1000, points2f_ptrs, coeffs2f, 0.002f));
} }
#endif
#ifdef EIGEN_TEST_PART_2
{ {
Vector2f points2f [1000]; Vector2f points2f [1000];
Vector2f *points2f_ptrs [1000]; Vector2f *points2f_ptrs [1000];
@ -119,7 +121,8 @@ void test_eigen2_regression()
CALL_SUBTEST(check_fitHyperplane(100, points2f_ptrs, coeffs3f, 0.01f)); CALL_SUBTEST(check_fitHyperplane(100, points2f_ptrs, coeffs3f, 0.01f));
CALL_SUBTEST(check_fitHyperplane(1000, points2f_ptrs, coeffs3f, 0.002f)); CALL_SUBTEST(check_fitHyperplane(1000, points2f_ptrs, coeffs3f, 0.002f));
} }
#endif
#ifdef EIGEN_TEST_PART_3
{ {
Vector4d points4d [1000]; Vector4d points4d [1000];
Vector4d *points4d_ptrs [1000]; Vector4d *points4d_ptrs [1000];
@ -130,7 +133,8 @@ void test_eigen2_regression()
CALL_SUBTEST(check_fitHyperplane(100, points4d_ptrs, coeffs5d, 0.01)); CALL_SUBTEST(check_fitHyperplane(100, points4d_ptrs, coeffs5d, 0.01));
CALL_SUBTEST(check_fitHyperplane(1000, points4d_ptrs, coeffs5d, 0.002)); CALL_SUBTEST(check_fitHyperplane(1000, points4d_ptrs, coeffs5d, 0.002));
} }
#endif
#ifdef EIGEN_TEST_PART_4
{ {
VectorXcd *points11cd_ptrs[1000]; VectorXcd *points11cd_ptrs[1000];
for(int i = 0; i < 1000; i++) points11cd_ptrs[i] = new VectorXcd(11); for(int i = 0; i < 1000; i++) points11cd_ptrs[i] = new VectorXcd(11);
@ -141,5 +145,6 @@ void test_eigen2_regression()
delete coeffs12cd; delete coeffs12cd;
for(int i = 0; i < 1000; i++) delete points11cd_ptrs[i]; for(int i = 0; i < 1000; i++) delete points11cd_ptrs[i];
} }
#endif
} }
} }

View File

@ -323,10 +323,10 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re
void test_eigen2_sparse_basic() void test_eigen2_sparse_basic()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( sparse_basic(SparseMatrix<double>(8, 8)) ); CALL_SUBTEST_1( sparse_basic(SparseMatrix<double>(8, 8)) );
CALL_SUBTEST( sparse_basic(SparseMatrix<std::complex<double> >(16, 16)) ); CALL_SUBTEST_2( sparse_basic(SparseMatrix<std::complex<double> >(16, 16)) );
CALL_SUBTEST( sparse_basic(SparseMatrix<double>(33, 33)) ); CALL_SUBTEST_1( sparse_basic(SparseMatrix<double>(33, 33)) );
CALL_SUBTEST( sparse_basic(DynamicSparseMatrix<double>(8, 8)) ); CALL_SUBTEST_3( sparse_basic(DynamicSparseMatrix<double>(8, 8)) );
} }
} }

View File

@ -121,10 +121,10 @@ template<typename SparseMatrixType> void sparse_product(const SparseMatrixType&
void test_eigen2_sparse_product() void test_eigen2_sparse_product()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( sparse_product(SparseMatrix<double>(8, 8)) ); CALL_SUBTEST_1( sparse_product(SparseMatrix<double>(8, 8)) );
CALL_SUBTEST( sparse_product(SparseMatrix<std::complex<double> >(16, 16)) ); CALL_SUBTEST_2( sparse_product(SparseMatrix<std::complex<double> >(16, 16)) );
CALL_SUBTEST( sparse_product(SparseMatrix<double>(33, 33)) ); CALL_SUBTEST_1( sparse_product(SparseMatrix<double>(33, 33)) );
CALL_SUBTEST( sparse_product(DynamicSparseMatrix<double>(8, 8)) ); CALL_SUBTEST_3( sparse_product(DynamicSparseMatrix<double>(8, 8)) );
} }
} }

View File

@ -208,8 +208,8 @@ template<typename Scalar> void sparse_solvers(int rows, int cols)
void test_eigen2_sparse_solvers() void test_eigen2_sparse_solvers()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( sparse_solvers<double>(8, 8) ); CALL_SUBTEST_1( sparse_solvers<double>(8, 8) );
CALL_SUBTEST( sparse_solvers<std::complex<double> >(16, 16) ); CALL_SUBTEST_2( sparse_solvers<std::complex<double> >(16, 16) );
CALL_SUBTEST( sparse_solvers<double>(101, 101) ); CALL_SUBTEST_1( sparse_solvers<double>(101, 101) );
} }
} }

View File

@ -91,9 +91,9 @@ template<typename Scalar> void sparse_vector(int rows, int cols)
void test_eigen2_sparse_vector() void test_eigen2_sparse_vector()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( sparse_vector<double>(8, 8) ); CALL_SUBTEST_1( sparse_vector<double>(8, 8) );
CALL_SUBTEST( sparse_vector<std::complex<double> >(16, 16) ); CALL_SUBTEST_2( sparse_vector<std::complex<double> >(16, 16) );
CALL_SUBTEST( sparse_vector<double>(299, 535) ); CALL_SUBTEST_1( sparse_vector<double>(299, 535) );
} }
} }

View File

@ -135,29 +135,29 @@ void check_stdvector_quaternion(const QuaternionType&)
void test_eigen2_stdvector() void test_eigen2_stdvector()
{ {
// some non vectorizable fixed sizes // some non vectorizable fixed sizes
CALL_SUBTEST(check_stdvector_matrix(Vector2f())); CALL_SUBTEST_1(check_stdvector_matrix(Vector2f()));
CALL_SUBTEST(check_stdvector_matrix(Matrix3f())); CALL_SUBTEST_1(check_stdvector_matrix(Matrix3f()));
CALL_SUBTEST(check_stdvector_matrix(Matrix3d())); CALL_SUBTEST_1(check_stdvector_matrix(Matrix3d()));
// some vectorizable fixed sizes // some vectorizable fixed sizes
CALL_SUBTEST(check_stdvector_matrix(Matrix2f())); CALL_SUBTEST_2(check_stdvector_matrix(Matrix2f()));
CALL_SUBTEST(check_stdvector_matrix(Vector4f())); CALL_SUBTEST_2(check_stdvector_matrix(Vector4f()));
CALL_SUBTEST(check_stdvector_matrix(Matrix4f())); CALL_SUBTEST_2(check_stdvector_matrix(Matrix4f()));
CALL_SUBTEST(check_stdvector_matrix(Matrix4d())); CALL_SUBTEST_2(check_stdvector_matrix(Matrix4d()));
// some dynamic sizes // some dynamic sizes
CALL_SUBTEST(check_stdvector_matrix(MatrixXd(1,1))); CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1,1)));
CALL_SUBTEST(check_stdvector_matrix(VectorXd(20))); CALL_SUBTEST_3(check_stdvector_matrix(VectorXd(20)));
CALL_SUBTEST(check_stdvector_matrix(RowVectorXf(20))); CALL_SUBTEST_3(check_stdvector_matrix(RowVectorXf(20)));
CALL_SUBTEST(check_stdvector_matrix(MatrixXcf(10,10))); CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10,10)));
// some Transform // some Transform
CALL_SUBTEST(check_stdvector_transform(Transform2f())); CALL_SUBTEST_4(check_stdvector_transform(Transform2f()));
CALL_SUBTEST(check_stdvector_transform(Transform3f())); CALL_SUBTEST_4(check_stdvector_transform(Transform3f()));
CALL_SUBTEST(check_stdvector_transform(Transform3d())); CALL_SUBTEST_4(check_stdvector_transform(Transform3d()));
//CALL_SUBTEST(check_stdvector_transform(Transform4d())); //CALL_SUBTEST_4(check_stdvector_transform(Transform4d()));
// some Quaternion // some Quaternion
CALL_SUBTEST(check_stdvector_quaternion(Quaternionf())); CALL_SUBTEST_5(check_stdvector_quaternion(Quaternionf()));
CALL_SUBTEST(check_stdvector_quaternion(Quaternionf())); CALL_SUBTEST_5(check_stdvector_quaternion(Quaternionf()));
} }

View File

@ -153,11 +153,11 @@ template<typename MatrixType> void submatrices(const MatrixType& m)
void test_eigen2_submatrices() void test_eigen2_submatrices()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( submatrices(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( submatrices(Matrix<float, 1, 1>()) );
CALL_SUBTEST( submatrices(Matrix4d()) ); CALL_SUBTEST_2( submatrices(Matrix4d()) );
CALL_SUBTEST( submatrices(MatrixXcf(3, 3)) ); CALL_SUBTEST_3( submatrices(MatrixXcf(3, 3)) );
CALL_SUBTEST( submatrices(MatrixXi(8, 12)) ); CALL_SUBTEST_4( submatrices(MatrixXi(8, 12)) );
CALL_SUBTEST( submatrices(MatrixXcd(20, 20)) ); CALL_SUBTEST_5( submatrices(MatrixXcd(20, 20)) );
CALL_SUBTEST( submatrices(MatrixXf(20, 20)) ); CALL_SUBTEST_6( submatrices(MatrixXf(20, 20)) );
} }
} }

View File

@ -71,16 +71,16 @@ template<typename VectorType> void vectorSum(const VectorType& w)
void test_eigen2_sum() void test_eigen2_sum()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( matrixSum(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( matrixSum(Matrix<float, 1, 1>()) );
CALL_SUBTEST( matrixSum(Matrix2f()) ); CALL_SUBTEST_2( matrixSum(Matrix2f()) );
CALL_SUBTEST( matrixSum(Matrix4d()) ); CALL_SUBTEST_3( matrixSum(Matrix4d()) );
CALL_SUBTEST( matrixSum(MatrixXcf(3, 3)) ); CALL_SUBTEST_4( matrixSum(MatrixXcf(3, 3)) );
CALL_SUBTEST( matrixSum(MatrixXf(8, 12)) ); CALL_SUBTEST_5( matrixSum(MatrixXf(8, 12)) );
CALL_SUBTEST( matrixSum(MatrixXi(8, 12)) ); CALL_SUBTEST_6( matrixSum(MatrixXi(8, 12)) );
} }
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( vectorSum(VectorXf(5)) ); CALL_SUBTEST_5( vectorSum(VectorXf(5)) );
CALL_SUBTEST( vectorSum(VectorXd(10)) ); CALL_SUBTEST_7( vectorSum(VectorXd(10)) );
CALL_SUBTEST( vectorSum(VectorXf(33)) ); CALL_SUBTEST_5( vectorSum(VectorXf(33)) );
} }
} }

View File

@ -88,10 +88,10 @@ template<typename MatrixType> void svd(const MatrixType& m)
void test_eigen2_svd() void test_eigen2_svd()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( svd(Matrix3f()) ); CALL_SUBTEST_1( svd(Matrix3f()) );
CALL_SUBTEST( svd(Matrix4d()) ); CALL_SUBTEST_2( svd(Matrix4d()) );
CALL_SUBTEST( svd(MatrixXf(7,7)) ); CALL_SUBTEST_3( svd(MatrixXf(7,7)) );
CALL_SUBTEST( svd(MatrixXd(14,7)) ); CALL_SUBTEST_4( svd(MatrixXd(14,7)) );
// complex are not implemented yet // complex are not implemented yet
// CALL_SUBTEST( svd(MatrixXcd(6,6)) ); // CALL_SUBTEST( svd(MatrixXcd(6,6)) );
// CALL_SUBTEST( svd(MatrixXcf(3,3)) ); // CALL_SUBTEST( svd(MatrixXcf(3,3)) );

View File

@ -91,8 +91,8 @@ template<typename MatrixType> void swap(const MatrixType& m)
void test_eigen2_swap() void test_eigen2_swap()
{ {
CALL_SUBTEST( swap(Matrix3f()) ); // fixed size, no vectorization CALL_SUBTEST( swap_1(Matrix3f()) ); // fixed size, no vectorization
CALL_SUBTEST( swap(Matrix4d()) ); // fixed size, possible vectorization CALL_SUBTEST( swap_2(Matrix4d()) ); // fixed size, possible vectorization
CALL_SUBTEST( swap(MatrixXd(3,3)) ); // dyn size, no vectorization CALL_SUBTEST( swap_3(MatrixXd(3,3)) ); // dyn size, no vectorization
CALL_SUBTEST( swap(MatrixXf(30,30)) ); // dyn size, possible vectorization CALL_SUBTEST( swap_4(MatrixXf(30,30)) ); // dyn size, possible vectorization
} }

View File

@ -127,12 +127,12 @@ template<typename MatrixType> void triangular(const MatrixType& m)
void test_eigen2_triangular() void test_eigen2_triangular()
{ {
for(int i = 0; i < g_repeat ; i++) { for(int i = 0; i < g_repeat ; i++) {
CALL_SUBTEST( triangular(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( triangular(Matrix<float, 1, 1>()) );
CALL_SUBTEST( triangular(Matrix<float, 2, 2>()) ); CALL_SUBTEST_2( triangular(Matrix<float, 2, 2>()) );
CALL_SUBTEST( triangular(Matrix3d()) ); CALL_SUBTEST_3( triangular(Matrix3d()) );
CALL_SUBTEST( triangular(MatrixXcf(4, 4)) ); CALL_SUBTEST_4( triangular(MatrixXcf(4, 4)) );
CALL_SUBTEST( triangular(Matrix<std::complex<float>,8, 8>()) ); CALL_SUBTEST_5( triangular(Matrix<std::complex<float>,8, 8>()) );
CALL_SUBTEST( triangular(MatrixXd(17,17)) ); CALL_SUBTEST_6( triangular(MatrixXd(17,17)) );
CALL_SUBTEST( triangular(Matrix<float,Dynamic,Dynamic,RowMajor>(5, 5)) ); CALL_SUBTEST_7( triangular(Matrix<float,Dynamic,Dynamic,RowMajor>(5, 5)) );
} }
} }

View File

@ -115,17 +115,17 @@ template<typename VectorType> void vectorVisitor(const VectorType& w)
void test_eigen2_visitor() void test_eigen2_visitor()
{ {
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( matrixVisitor(Matrix<float, 1, 1>()) ); CALL_SUBTEST_1( matrixVisitor(Matrix<float, 1, 1>()) );
CALL_SUBTEST( matrixVisitor(Matrix2f()) ); CALL_SUBTEST_2( matrixVisitor(Matrix2f()) );
CALL_SUBTEST( matrixVisitor(Matrix4d()) ); CALL_SUBTEST_3( matrixVisitor(Matrix4d()) );
CALL_SUBTEST( matrixVisitor(MatrixXd(8, 12)) ); CALL_SUBTEST_4( matrixVisitor(MatrixXd(8, 12)) );
CALL_SUBTEST( matrixVisitor(Matrix<double,Dynamic,Dynamic,RowMajor>(20, 20)) ); CALL_SUBTEST_5( matrixVisitor(Matrix<double,Dynamic,Dynamic,RowMajor>(20, 20)) );
CALL_SUBTEST( matrixVisitor(MatrixXi(8, 12)) ); CALL_SUBTEST_6( matrixVisitor(MatrixXi(8, 12)) );
} }
for(int i = 0; i < g_repeat; i++) { for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( vectorVisitor(Vector4f()) ); CALL_SUBTEST_7( vectorVisitor(Vector4f()) );
CALL_SUBTEST( vectorVisitor(VectorXd(10)) ); CALL_SUBTEST_4( vectorVisitor(VectorXd(10)) );
CALL_SUBTEST( vectorVisitor(RowVectorXd(10)) ); CALL_SUBTEST_4( vectorVisitor(RowVectorXd(10)) );
CALL_SUBTEST( vectorVisitor(VectorXf(33)) ); CALL_SUBTEST_8( vectorVisitor(VectorXf(33)) );
} }
} }

View File

@ -240,6 +240,104 @@ void EI_PP_CAT(test_,EIGEN_TEST_FUNC)();
using namespace Eigen; using namespace Eigen;
#ifdef EIGEN_TEST_PART_1
#define CALL_SUBTEST_1(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_1(FUNC)
#endif
#ifdef EIGEN_TEST_PART_2
#define CALL_SUBTEST_2(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_2(FUNC)
#endif
#ifdef EIGEN_TEST_PART_3
#define CALL_SUBTEST_3(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_3(FUNC)
#endif
#ifdef EIGEN_TEST_PART_4
#define CALL_SUBTEST_4(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_4(FUNC)
#endif
#ifdef EIGEN_TEST_PART_5
#define CALL_SUBTEST_5(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_5(FUNC)
#endif
#ifdef EIGEN_TEST_PART_6
#define CALL_SUBTEST_6(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_6(FUNC)
#endif
#ifdef EIGEN_TEST_PART_7
#define CALL_SUBTEST_7(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_7(FUNC)
#endif
#ifdef EIGEN_TEST_PART_8
#define CALL_SUBTEST_8(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_8(FUNC)
#endif
#ifdef EIGEN_TEST_PART_9
#define CALL_SUBTEST_9(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_9(FUNC)
#endif
#ifdef EIGEN_TEST_PART_10
#define CALL_SUBTEST_10(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_10(FUNC)
#endif
#ifdef EIGEN_TEST_PART_11
#define CALL_SUBTEST_11(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_11(FUNC)
#endif
#ifdef EIGEN_TEST_PART_12
#define CALL_SUBTEST_12(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_12(FUNC)
#endif
#ifdef EIGEN_TEST_PART_13
#define CALL_SUBTEST_13(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_13(FUNC)
#endif
#ifdef EIGEN_TEST_PART_14
#define CALL_SUBTEST_14(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_14(FUNC)
#endif
#ifdef EIGEN_TEST_PART_15
#define CALL_SUBTEST_15(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_15(FUNC)
#endif
#ifdef EIGEN_TEST_PART_16
#define CALL_SUBTEST_16(FUNC) CALL_SUBTEST(FUNC)
#else
#define CALL_SUBTEST_16(FUNC)
#endif
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
bool has_set_repeat = false; bool has_set_repeat = false;