diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-01-26 16:36:07 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-01-26 16:36:07 +0100 |
commit | 98285ba81c8e90c95434bfa262484f2aa5d2664b (patch) | |
tree | 27348c602174eea9b650df8e9d0abca3881ed974 /test | |
parent | 7ef9d82b39b338c814f4c120ef3dea58a244a391 (diff) | |
parent | 76c630d185b4a9eda5261a6f4651cafdebb91508 (diff) |
merge
Diffstat (limited to 'test')
-rw-r--r-- | test/eigen2/CMakeLists.txt | 174 | ||||
-rw-r--r-- | test/eigen2/eigen2_adjoint.cpp (renamed from test/eigen2/adjoint.cpp) | 16 | ||||
-rw-r--r-- | test/eigen2/eigen2_alignedbox.cpp (renamed from test/eigen2/alignedbox.cpp) | 8 | ||||
-rw-r--r-- | test/eigen2/eigen2_array.cpp (renamed from test/eigen2/array.cpp) | 36 | ||||
-rw-r--r-- | test/eigen2/eigen2_basicstuff.cpp (renamed from test/eigen2/basicstuff.cpp) | 16 | ||||
-rw-r--r-- | test/eigen2/eigen2_bug_132.cpp (renamed from test/eigen2/bug_132.cpp) | 4 | ||||
-rw-r--r-- | test/eigen2/eigen2_cholesky.cpp (renamed from test/eigen2/cholesky.cpp) | 18 | ||||
-rw-r--r-- | test/eigen2/eigen2_commainitializer.cpp (renamed from test/eigen2/commainitializer.cpp) | 2 | ||||
-rw-r--r-- | test/eigen2/eigen2_cwiseop.cpp (renamed from test/eigen2/cwiseop.cpp) | 14 | ||||
-rw-r--r-- | test/eigen2/eigen2_determinant.cpp (renamed from test/eigen2/determinant.cpp) | 16 | ||||
-rw-r--r-- | test/eigen2/eigen2_dynalloc.cpp (renamed from test/eigen2/dynalloc.cpp) | 2 | ||||
-rw-r--r-- | test/eigen2/eigen2_eigensolver.cpp (renamed from test/eigen2/eigensolver.cpp) | 18 | ||||
-rw-r--r-- | test/eigen2/eigen2_first_aligned.cpp (renamed from test/eigen2/first_aligned.cpp) | 6 | ||||
-rw-r--r-- | test/eigen2/eigen2_geometry.cpp (renamed from test/eigen2/geometry.cpp) | 6 | ||||
-rw-r--r-- | test/eigen2/eigen2_hyperplane.cpp (renamed from test/eigen2/hyperplane.cpp) | 14 | ||||
-rw-r--r-- | test/eigen2/eigen2_inverse.cpp (renamed from test/eigen2/inverse.cpp) | 14 | ||||
-rw-r--r-- | test/eigen2/eigen2_linearstructure.cpp (renamed from test/eigen2/linearstructure.cpp) | 18 | ||||
-rw-r--r-- | test/eigen2/eigen2_lu.cpp (renamed from test/eigen2/lu.cpp) | 26 | ||||
-rw-r--r-- | test/eigen2/eigen2_map.cpp (renamed from test/eigen2/map.cpp) | 32 | ||||
-rw-r--r-- | test/eigen2/eigen2_meta.cpp (renamed from test/eigen2/meta.cpp) | 2 | ||||
-rw-r--r-- | test/eigen2/eigen2_miscmatrices.cpp (renamed from test/eigen2/miscmatrices.cpp) | 12 | ||||
-rw-r--r-- | test/eigen2/eigen2_mixingtypes.cpp (renamed from test/eigen2/mixingtypes.cpp) | 8 | ||||
-rw-r--r-- | test/eigen2/eigen2_newstdvector.cpp (renamed from test/eigen2/newstdvector.cpp) | 34 | ||||
-rw-r--r-- | test/eigen2/eigen2_nomalloc.cpp (renamed from test/eigen2/nomalloc.cpp) | 8 | ||||
-rw-r--r-- | test/eigen2/eigen2_packetmath.cpp (renamed from test/eigen2/packetmath.cpp) | 10 | ||||
-rw-r--r-- | test/eigen2/eigen2_parametrizedline.cpp (renamed from test/eigen2/parametrizedline.cpp) | 10 | ||||
-rw-r--r-- | test/eigen2/eigen2_prec_inverse_4x4.cpp (renamed from test/eigen2/prec_inverse_4x4.cpp) | 14 | ||||
-rw-r--r-- | test/eigen2/eigen2_product_large.cpp (renamed from test/eigen2/product_large.cpp) | 14 | ||||
-rw-r--r-- | test/eigen2/eigen2_product_small.cpp (renamed from test/eigen2/product_small.cpp) | 12 | ||||
-rw-r--r-- | test/eigen2/eigen2_qr.cpp (renamed from test/eigen2/qr.cpp) | 27 | ||||
-rw-r--r-- | test/eigen2/eigen2_qtvector.cpp (renamed from test/eigen2/qtvector.cpp) | 36 | ||||
-rw-r--r-- | test/eigen2/eigen2_regression.cpp (renamed from test/eigen2/regression.cpp) | 13 | ||||
-rw-r--r-- | test/eigen2/eigen2_sizeof.cpp (renamed from test/eigen2/sizeof.cpp) | 2 | ||||
-rw-r--r-- | test/eigen2/eigen2_smallvectors.cpp (renamed from test/eigen2/smallvectors.cpp) | 2 | ||||
-rw-r--r-- | test/eigen2/eigen2_sparse_basic.cpp (renamed from test/eigen2/sparse_basic.cpp) | 10 | ||||
-rw-r--r-- | test/eigen2/eigen2_sparse_product.cpp (renamed from test/eigen2/sparse_product.cpp) | 10 | ||||
-rw-r--r-- | test/eigen2/eigen2_sparse_solvers.cpp (renamed from test/eigen2/sparse_solvers.cpp) | 8 | ||||
-rw-r--r-- | test/eigen2/eigen2_sparse_vector.cpp (renamed from test/eigen2/sparse_vector.cpp) | 8 | ||||
-rw-r--r-- | test/eigen2/eigen2_stdvector.cpp (renamed from test/eigen2/stdvector.cpp) | 36 | ||||
-rw-r--r-- | test/eigen2/eigen2_submatrices.cpp (renamed from test/eigen2/submatrices.cpp) | 14 | ||||
-rw-r--r-- | test/eigen2/eigen2_sum.cpp (renamed from test/eigen2/sum.cpp) | 20 | ||||
-rw-r--r-- | test/eigen2/eigen2_svd.cpp (renamed from test/eigen2/svd.cpp) | 10 | ||||
-rw-r--r-- | test/eigen2/eigen2_swap.cpp (renamed from test/eigen2/swap.cpp) | 10 | ||||
-rw-r--r-- | test/eigen2/eigen2_triangular.cpp (renamed from test/eigen2/triangular.cpp) | 51 | ||||
-rw-r--r-- | test/eigen2/eigen2_unalignedassert.cpp (renamed from test/eigen2/unalignedassert.cpp) | 2 | ||||
-rw-r--r-- | test/eigen2/eigen2_visitor.cpp (renamed from test/eigen2/visitor.cpp) | 22 | ||||
-rw-r--r-- | test/eigen2/main.h | 98 | ||||
-rw-r--r-- | test/selfadjoint.cpp | 7 | ||||
-rw-r--r-- | test/triangular.cpp | 7 |
49 files changed, 517 insertions, 440 deletions
diff --git a/test/eigen2/CMakeLists.txt b/test/eigen2/CMakeLists.txt index 9b128396f..45b0bbd84 100644 --- a/test/eigen2/CMakeLists.txt +++ b/test/eigen2/CMakeLists.txt @@ -1,132 +1,58 @@ -add_custom_target(buildtests_eigen2) -add_custom_target(check_eigen2 COMMAND "ctest") -add_dependencies(check_eigen2 buildtests_eigen2) +add_custom_target(eigen2_buildtests) +add_custom_target(eigen2_check COMMAND "ctest -R eigen2") +add_dependencies(eigen2_check eigen2_buildtests) +add_dependencies(buildtests eigen2_buildtests) add_definitions("-DEIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API") -# Macro to add a test -# -# the unique parameter testname must correspond to a file -# <testname>.cpp which follows this pattern: -# -# #include "main.h" -# void test_<testname>() { ... } -# -# this macro add an executable test_<testname> as well as a ctest test -# named <testname> -# -# On platforms with bash simply run: -# "ctest -V" or "ctest -V -R <testname>" -# On other platform use ctest as usual -# -macro(ei_add_test_eigen2 testname) - - set(targetname test_eigen2_${testname}) - - set(filename ${testname}.cpp) - add_executable(${targetname} ${filename}) - add_dependencies(buildtests_eigen2 ${targetname}) - - if(NOT EIGEN_NO_ASSERTION_CHECKING) - - if(MSVC) - set_target_properties(${targetname} PROPERTIES COMPILE_FLAGS "/EHsc") - else(MSVC) - set_target_properties(${targetname} PROPERTIES COMPILE_FLAGS "-fexceptions") - endif(MSVC) - - option(EIGEN_DEBUG_ASSERTS "Enable debuging of assertions" OFF) - if(EIGEN_DEBUG_ASSERTS) - set_target_properties(${targetname} PROPERTIES COMPILE_DEFINITIONS "EIGEN_DEBUG_ASSERTS=1") - endif(EIGEN_DEBUG_ASSERTS) - - endif(NOT EIGEN_NO_ASSERTION_CHECKING) - - if(${ARGC} GREATER 1) - ei_add_target_property(${targetname} COMPILE_FLAGS "${ARGV1}") - endif(${ARGC} GREATER 1) - - ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_FUNC=${testname}") - - if(TEST_LIB) - target_link_libraries(${targetname} Eigen2) - endif(TEST_LIB) - - if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) - target_link_libraries(${targetname} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) - endif() - - target_link_libraries(${targetname} ${EXTERNAL_LIBS}) - if(${ARGC} GREATER 2) - string(STRIP "${ARGV2}" ARGV2_stripped) - string(LENGTH "${ARGV2_stripped}" ARGV2_stripped_length) - if(${ARGV2_stripped_length} GREATER 0) - target_link_libraries(${targetname} ${ARGV2}) - endif(${ARGV2_stripped_length} GREATER 0) - endif(${ARGC} GREATER 2) - - if(WIN32) - add_test(${testname} "${targetname}") - else(WIN32) - add_test(${testname} "${CMAKE_CURRENT_SOURCE_DIR}/runtest.sh" "${testname}") - endif(WIN32) - -endmacro(ei_add_test_eigen2) - -enable_testing() - -if(TEST_LIB) - add_definitions("-DEIGEN_EXTERN_INSTANTIATIONS=1") -endif(TEST_LIB) - -ei_add_test_eigen2(meta) -ei_add_test_eigen2(sizeof) -ei_add_test_eigen2(dynalloc) -ei_add_test_eigen2(nomalloc) -ei_add_test_eigen2(first_aligned) -ei_add_test_eigen2(mixingtypes) -ei_add_test_eigen2(packetmath) -ei_add_test_eigen2(unalignedassert) -#ei_add_test_eigen2(vectorization_logic) -ei_add_test_eigen2(basicstuff) -ei_add_test_eigen2(linearstructure) -ei_add_test_eigen2(cwiseop) -ei_add_test_eigen2(sum) -ei_add_test_eigen2(product_small) -ei_add_test_eigen2(product_large ${EI_OFLAG}) -ei_add_test_eigen2(adjoint) -ei_add_test_eigen2(submatrices) -ei_add_test_eigen2(miscmatrices) -ei_add_test_eigen2(commainitializer) -ei_add_test_eigen2(smallvectors) -ei_add_test_eigen2(map) -ei_add_test_eigen2(array) -ei_add_test_eigen2(triangular) -ei_add_test_eigen2(cholesky " " "${GSL_LIBRARIES}") -ei_add_test_eigen2(lu ${EI_OFLAG}) -ei_add_test_eigen2(determinant ${EI_OFLAG}) -ei_add_test_eigen2(inverse) -ei_add_test_eigen2(qr) -ei_add_test_eigen2(eigensolver " " "${GSL_LIBRARIES}") -ei_add_test_eigen2(svd) -ei_add_test_eigen2(geometry) -ei_add_test_eigen2(hyperplane) -ei_add_test_eigen2(parametrizedline) -ei_add_test_eigen2(alignedbox) -ei_add_test_eigen2(regression) -ei_add_test_eigen2(stdvector) -ei_add_test_eigen2(newstdvector) +ei_add_test(eigen2_meta) +ei_add_test(eigen2_sizeof) +ei_add_test(eigen2_dynalloc) +ei_add_test(eigen2_nomalloc) +#ei_add_test(eigen2_first_aligned) +ei_add_test(eigen2_mixingtypes) +ei_add_test(eigen2_packetmath) +ei_add_test(eigen2_unalignedassert) +#ei_add_test(eigen2_vectorization_logic) +ei_add_test(eigen2_basicstuff) +ei_add_test(eigen2_linearstructure) +ei_add_test(eigen2_cwiseop) +ei_add_test(eigen2_sum) +ei_add_test(eigen2_product_small) +ei_add_test(eigen2_product_large ${EI_OFLAG}) +ei_add_test(eigen2_adjoint) +ei_add_test(eigen2_submatrices) +ei_add_test(eigen2_miscmatrices) +ei_add_test(eigen2_commainitializer) +ei_add_test(eigen2_smallvectors) +ei_add_test(eigen2_map) +ei_add_test(eigen2_array) +ei_add_test(eigen2_triangular) +ei_add_test(eigen2_cholesky " " "${GSL_LIBRARIES}") +ei_add_test(eigen2_lu ${EI_OFLAG}) +ei_add_test(eigen2_determinant ${EI_OFLAG}) +ei_add_test(eigen2_inverse) +ei_add_test(eigen2_qr) +ei_add_test(eigen2_eigensolver " " "${GSL_LIBRARIES}") +ei_add_test(eigen2_svd) +ei_add_test(eigen2_geometry) +ei_add_test(eigen2_hyperplane) +ei_add_test(eigen2_parametrizedline) +ei_add_test(eigen2_alignedbox) +ei_add_test(eigen2_regression) +ei_add_test(eigen2_stdvector) +ei_add_test(eigen2_newstdvector) if(QT4_FOUND) - ei_add_test_eigen2(qtvector " " "${QT_QTCORE_LIBRARY}") + ei_add_test(eigen2_qtvector " " "${QT_QTCORE_LIBRARY}") endif(QT4_FOUND) if(NOT EIGEN_DEFAULT_TO_ROW_MAJOR) - ei_add_test_eigen2(sparse_vector) - ei_add_test_eigen2(sparse_basic) - ei_add_test_eigen2(sparse_solvers " " "${SPARSE_LIBS}") - ei_add_test_eigen2(sparse_product) + ei_add_test(eigen2_sparse_vector) + ei_add_test(eigen2_sparse_basic) + ei_add_test(eigen2_sparse_solvers " " "${SPARSE_LIBS}") + ei_add_test(eigen2_sparse_product) endif() -ei_add_test_eigen2(swap) -ei_add_test_eigen2(visitor) -ei_add_test_eigen2(bug_132) +ei_add_test(eigen2_swap) +ei_add_test(eigen2_visitor) +ei_add_test(eigen2_bug_132) -ei_add_test_eigen2(prec_inverse_4x4 ${EI_OFLAG}) +ei_add_test(eigen2_prec_inverse_4x4 ${EI_OFLAG}) diff --git a/test/eigen2/adjoint.cpp b/test/eigen2/eigen2_adjoint.cpp index f553bad02..c090b9650 100644 --- a/test/eigen2/adjoint.cpp +++ b/test/eigen2/eigen2_adjoint.cpp @@ -100,17 +100,17 @@ template<typename MatrixType> void adjoint(const MatrixType& m) } -void test_adjoint() +void test_eigen2_adjoint() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( adjoint(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( adjoint(Matrix3d()) ); - CALL_SUBTEST( adjoint(Matrix4f()) ); - CALL_SUBTEST( adjoint(MatrixXcf(4, 4)) ); - CALL_SUBTEST( adjoint(MatrixXi(8, 12)) ); - CALL_SUBTEST( adjoint(MatrixXf(21, 21)) ); + CALL_SUBTEST_1( adjoint(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( adjoint(Matrix3d()) ); + CALL_SUBTEST_3( adjoint(Matrix4f()) ); + CALL_SUBTEST_4( adjoint(MatrixXcf(4, 4)) ); + CALL_SUBTEST_5( adjoint(MatrixXi(8, 12)) ); + CALL_SUBTEST_6( adjoint(MatrixXf(21, 21)) ); } // test a large matrix only once - CALL_SUBTEST( adjoint(Matrix<float, 100, 100>()) ); + CALL_SUBTEST_7( adjoint(Matrix<float, 100, 100>()) ); } diff --git a/test/eigen2/alignedbox.cpp b/test/eigen2/eigen2_alignedbox.cpp index 53d61b62d..c24c11d03 100644 --- a/test/eigen2/alignedbox.cpp +++ b/test/eigen2/eigen2_alignedbox.cpp @@ -65,11 +65,11 @@ template<typename BoxType> void alignedbox(const BoxType& _box) VERIFY_IS_APPROX(hp1d.template cast<Scalar>(),b0); } -void test_alignedbox() +void test_eigen2_alignedbox() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( alignedbox(AlignedBox<float,2>()) ); - CALL_SUBTEST( alignedbox(AlignedBox<float,3>()) ); - CALL_SUBTEST( alignedbox(AlignedBox<double,4>()) ); + CALL_SUBTEST_1( alignedbox(AlignedBox<float,2>()) ); + CALL_SUBTEST_2( alignedbox(AlignedBox<float,3>()) ); + CALL_SUBTEST_3( alignedbox(AlignedBox<double,4>()) ); } } diff --git a/test/eigen2/array.cpp b/test/eigen2/eigen2_array.cpp index 2ea5ebd65..03977e446 100644 --- a/test/eigen2/array.cpp +++ b/test/eigen2/eigen2_array.cpp @@ -129,29 +129,29 @@ template<typename VectorType> void lpNorm(const VectorType& v) VERIFY_IS_APPROX(ei_pow(u.template lpNorm<5>(), typename VectorType::RealScalar(5)), u.cwise().abs().cwise().pow(5).sum()); } -void test_array() +void test_eigen2_array() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( array(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( array(Matrix2f()) ); - CALL_SUBTEST( array(Matrix4d()) ); - CALL_SUBTEST( array(MatrixXcf(3, 3)) ); - CALL_SUBTEST( array(MatrixXf(8, 12)) ); - CALL_SUBTEST( array(MatrixXi(8, 12)) ); + CALL_SUBTEST_1( array(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( array(Matrix2f()) ); + CALL_SUBTEST_3( array(Matrix4d()) ); + CALL_SUBTEST_4( array(MatrixXcf(3, 3)) ); + CALL_SUBTEST_5( array(MatrixXf(8, 12)) ); + CALL_SUBTEST_6( array(MatrixXi(8, 12)) ); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( comparisons(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( comparisons(Matrix2f()) ); - CALL_SUBTEST( comparisons(Matrix4d()) ); - CALL_SUBTEST( comparisons(MatrixXf(8, 12)) ); - CALL_SUBTEST( comparisons(MatrixXi(8, 12)) ); + CALL_SUBTEST_1( comparisons(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( comparisons(Matrix2f()) ); + CALL_SUBTEST_3( comparisons(Matrix4d()) ); + CALL_SUBTEST_5( comparisons(MatrixXf(8, 12)) ); + CALL_SUBTEST_6( comparisons(MatrixXi(8, 12)) ); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( lpNorm(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( lpNorm(Vector2f()) ); - CALL_SUBTEST( lpNorm(Vector3d()) ); - CALL_SUBTEST( lpNorm(Vector4f()) ); - CALL_SUBTEST( lpNorm(VectorXf(16)) ); - CALL_SUBTEST( lpNorm(VectorXcd(10)) ); + CALL_SUBTEST_1( lpNorm(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( lpNorm(Vector2f()) ); + CALL_SUBTEST_3( lpNorm(Vector3d()) ); + CALL_SUBTEST_4( lpNorm(Vector4f()) ); + CALL_SUBTEST_5( lpNorm(VectorXf(16)) ); + CALL_SUBTEST_7( lpNorm(VectorXcd(10)) ); } } diff --git a/test/eigen2/basicstuff.cpp b/test/eigen2/eigen2_basicstuff.cpp index 21473cf8a..a09930fae 100644 --- a/test/eigen2/basicstuff.cpp +++ b/test/eigen2/eigen2_basicstuff.cpp @@ -109,15 +109,15 @@ template<typename MatrixType> void basicStuff(const MatrixType& m) } } -void test_basicstuff() +void test_eigen2_basicstuff() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( basicStuff(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( basicStuff(Matrix4d()) ); - CALL_SUBTEST( basicStuff(MatrixXcf(3, 3)) ); - CALL_SUBTEST( basicStuff(MatrixXi(8, 12)) ); - CALL_SUBTEST( basicStuff(MatrixXcd(20, 20)) ); - CALL_SUBTEST( basicStuff(Matrix<float, 100, 100>()) ); - CALL_SUBTEST( basicStuff(Matrix<long double,Dynamic,Dynamic>(10,10)) ); + CALL_SUBTEST_1( basicStuff(Matrix<float, 1, 1>()) ); + 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_6( basicStuff(Matrix<float, 100, 100>()) ); + CALL_SUBTEST_7( basicStuff(Matrix<long double,Dynamic,Dynamic>(10,10)) ); } } diff --git a/test/eigen2/bug_132.cpp b/test/eigen2/eigen2_bug_132.cpp index aa9bf2c28..7c33e394f 100644 --- a/test/eigen2/bug_132.cpp +++ b/test/eigen2/eigen2_bug_132.cpp @@ -24,8 +24,8 @@ #include "main.h" -void test_bug_132() { - enum { size = 100 }; +void test_eigen2_bug_132() { + int size = 100; MatrixXd A(size, size); VectorXd b(size), c(size); { diff --git a/test/eigen2/cholesky.cpp b/test/eigen2/eigen2_cholesky.cpp index 108db9a21..d1a23dd05 100644 --- a/test/eigen2/cholesky.cpp +++ b/test/eigen2/eigen2_cholesky.cpp @@ -113,19 +113,21 @@ template<typename MatrixType> void cholesky(const MatrixType& m) #endif } -void test_cholesky() +void test_eigen2_cholesky() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( cholesky(Matrix<double,1,1>()) ); - CALL_SUBTEST( cholesky(Matrix2d()) ); - CALL_SUBTEST( cholesky(Matrix3f()) ); - CALL_SUBTEST( cholesky(Matrix4d()) ); - CALL_SUBTEST( cholesky(MatrixXcd(7,7)) ); - CALL_SUBTEST( cholesky(MatrixXf(17,17)) ); - CALL_SUBTEST( cholesky(MatrixXd(33,33)) ); + CALL_SUBTEST_1( cholesky(Matrix<double,1,1>()) ); + CALL_SUBTEST_2( cholesky(Matrix2d()) ); + CALL_SUBTEST_3( cholesky(Matrix3f()) ); + CALL_SUBTEST_4( cholesky(Matrix4d()) ); + CALL_SUBTEST_5( cholesky(MatrixXcd(7,7)) ); + CALL_SUBTEST_6( cholesky(MatrixXf(17,17)) ); + CALL_SUBTEST_7( cholesky(MatrixXd(33,33)) ); } +#ifdef EIGEN_TEST_PART_6 MatrixXf m = MatrixXf::Zero(10,10); VectorXf b = VectorXf::Zero(10); VERIFY(!m.llt().isPositiveDefinite()); +#endif } diff --git a/test/eigen2/commainitializer.cpp b/test/eigen2/eigen2_commainitializer.cpp index 503dd9be4..294ca446a 100644 --- a/test/eigen2/commainitializer.cpp +++ b/test/eigen2/eigen2_commainitializer.cpp @@ -24,7 +24,7 @@ #include "main.h" -void test_commainitializer() +void test_eigen2_commainitializer() { Matrix3d m3; Matrix4d m4; diff --git a/test/eigen2/cwiseop.cpp b/test/eigen2/eigen2_cwiseop.cpp index 25966db9a..cc647d372 100644 --- a/test/eigen2/cwiseop.cpp +++ b/test/eigen2/eigen2_cwiseop.cpp @@ -160,14 +160,14 @@ template<typename MatrixType> void cwiseops(const MatrixType& m) VERIFY( !(m1.cwise()>m1.unaryExpr(bind2nd(plus<Scalar>(), Scalar(1)))).any() ); } -void test_cwiseop() +void test_eigen2_cwiseop() { for(int i = 0; i < g_repeat ; i++) { - CALL_SUBTEST( cwiseops(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( cwiseops(Matrix4d()) ); - CALL_SUBTEST( cwiseops(MatrixXf(3, 3)) ); - CALL_SUBTEST( cwiseops(MatrixXf(22, 22)) ); - CALL_SUBTEST( cwiseops(MatrixXi(8, 12)) ); - CALL_SUBTEST( cwiseops(MatrixXd(20, 20)) ); + CALL_SUBTEST_1( cwiseops(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( cwiseops(Matrix4d()) ); + CALL_SUBTEST_3( cwiseops(MatrixXf(3, 3)) ); + CALL_SUBTEST_3( cwiseops(MatrixXf(22, 22)) ); + CALL_SUBTEST_4( cwiseops(MatrixXi(8, 12)) ); + CALL_SUBTEST_5( cwiseops(MatrixXd(20, 20)) ); } } diff --git a/test/eigen2/determinant.cpp b/test/eigen2/eigen2_determinant.cpp index bc647d25d..5a01856bf 100644 --- a/test/eigen2/determinant.cpp +++ b/test/eigen2/eigen2_determinant.cpp @@ -62,15 +62,15 @@ template<typename MatrixType> void determinant(const MatrixType& m) VERIFY_IS_APPROX(m2.determinant(), m1.determinant() * x); } -void test_determinant() +void test_eigen2_determinant() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( determinant(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( determinant(Matrix<double, 2, 2>()) ); - CALL_SUBTEST( determinant(Matrix<double, 3, 3>()) ); - CALL_SUBTEST( determinant(Matrix<double, 4, 4>()) ); - CALL_SUBTEST( determinant(Matrix<std::complex<double>, 10, 10>()) ); - CALL_SUBTEST( determinant(MatrixXd(20, 20)) ); + CALL_SUBTEST_1( determinant(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( determinant(Matrix<double, 2, 2>()) ); + CALL_SUBTEST_3( determinant(Matrix<double, 3, 3>()) ); + CALL_SUBTEST_4( determinant(Matrix<double, 4, 4>()) ); + CALL_SUBTEST_5( determinant(Matrix<std::complex<double>, 10, 10>()) ); + CALL_SUBTEST_6( determinant(MatrixXd(20, 20)) ); } - CALL_SUBTEST( determinant(MatrixXd(200, 200)) ); + CALL_SUBTEST_6( determinant(MatrixXd(200, 200)) ); } diff --git a/test/eigen2/dynalloc.cpp b/test/eigen2/eigen2_dynalloc.cpp index b7951a680..1902b7c94 100644 --- a/test/eigen2/dynalloc.cpp +++ b/test/eigen2/eigen2_dynalloc.cpp @@ -102,7 +102,7 @@ template<typename T> void check_dynaligned() delete obj; } -void test_dynalloc() +void test_eigen2_dynalloc() { // low level dynamic memory allocation CALL_SUBTEST(check_handmade_aligned_malloc()); diff --git a/test/eigen2/eigensolver.cpp b/test/eigen2/eigen2_eigensolver.cpp index 34b8a22bc..17111d559 100644 --- a/test/eigen2/eigensolver.cpp +++ b/test/eigen2/eigen2_eigensolver.cpp @@ -145,18 +145,18 @@ template<typename MatrixType> void eigensolver(const MatrixType& m) } -void test_eigensolver() +void test_eigen2_eigensolver() { for(int i = 0; i < g_repeat; i++) { // very important to test a 3x3 matrix since we provide a special path for it - CALL_SUBTEST( selfadjointeigensolver(Matrix3f()) ); - CALL_SUBTEST( selfadjointeigensolver(Matrix4d()) ); - CALL_SUBTEST( selfadjointeigensolver(MatrixXf(7,7)) ); - CALL_SUBTEST( selfadjointeigensolver(MatrixXcd(5,5)) ); - CALL_SUBTEST( selfadjointeigensolver(MatrixXd(19,19)) ); - - CALL_SUBTEST( eigensolver(Matrix4f()) ); - CALL_SUBTEST( eigensolver(MatrixXd(17,17)) ); + CALL_SUBTEST_1( selfadjointeigensolver(Matrix3f()) ); + CALL_SUBTEST_2( selfadjointeigensolver(Matrix4d()) ); + CALL_SUBTEST_3( selfadjointeigensolver(MatrixXf(7,7)) ); + CALL_SUBTEST_4( selfadjointeigensolver(MatrixXcd(5,5)) ); + CALL_SUBTEST_5( selfadjointeigensolver(MatrixXd(19,19)) ); + + CALL_SUBTEST_6( eigensolver(Matrix4f()) ); + CALL_SUBTEST_5( eigensolver(MatrixXd(17,17)) ); } } diff --git a/test/eigen2/first_aligned.cpp b/test/eigen2/eigen2_first_aligned.cpp index f630e42f9..f6a4a3ba2 100644 --- a/test/eigen2/first_aligned.cpp +++ b/test/eigen2/eigen2_first_aligned.cpp @@ -25,21 +25,21 @@ #include "main.h" template<typename Scalar> -void test_first_aligned_helper(Scalar *array, int size) +void test_eigen2_first_aligned_helper(Scalar *array, int size) { const int packet_size = sizeof(Scalar) * ei_packet_traits<Scalar>::size; VERIFY(((std::size_t(array) + sizeof(Scalar) * ei_alignmentOffset(array, size)) % packet_size) == 0); } template<typename Scalar> -void test_none_aligned_helper(Scalar *array, int size) +void test_eigen2_none_aligned_helper(Scalar *array, int size) { VERIFY(ei_packet_traits<Scalar>::size == 1 || ei_alignmentOffset(array, size) == size); } struct some_non_vectorizable_type { float x; }; -void test_first_aligned() +void test_eigen2_first_aligned() { EIGEN_ALIGN_128 float array_float[100]; test_first_aligned_helper(array_float, 50); diff --git a/test/eigen2/geometry.cpp b/test/eigen2/eigen2_geometry.cpp index d0e69439b..cec413a9b 100644 --- a/test/eigen2/geometry.cpp +++ b/test/eigen2/eigen2_geometry.cpp @@ -437,10 +437,10 @@ template<typename Scalar> void geometry(void) } -void test_geometry() +void test_eigen2_geometry() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( geometry<float>() ); - CALL_SUBTEST( geometry<double>() ); + CALL_SUBTEST_1( geometry<float>() ); + CALL_SUBTEST_2( geometry<double>() ); } } diff --git a/test/eigen2/hyperplane.cpp b/test/eigen2/eigen2_hyperplane.cpp index f1a96a717..de6265ec0 100644 --- a/test/eigen2/hyperplane.cpp +++ b/test/eigen2/eigen2_hyperplane.cpp @@ -128,14 +128,14 @@ template<typename Scalar> void lines() } } -void test_hyperplane() +void test_eigen2_hyperplane() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( hyperplane(Hyperplane<float,2>()) ); - CALL_SUBTEST( hyperplane(Hyperplane<float,3>()) ); - CALL_SUBTEST( hyperplane(Hyperplane<double,4>()) ); - CALL_SUBTEST( hyperplane(Hyperplane<std::complex<double>,5>()) ); - CALL_SUBTEST( lines<float>() ); - CALL_SUBTEST( lines<double>() ); + CALL_SUBTEST_1( hyperplane(Hyperplane<float,2>()) ); + CALL_SUBTEST_2( hyperplane(Hyperplane<float,3>()) ); + CALL_SUBTEST_3( hyperplane(Hyperplane<double,4>()) ); + CALL_SUBTEST_4( hyperplane(Hyperplane<std::complex<double>,5>()) ); + CALL_SUBTEST_5( lines<float>() ); + CALL_SUBTEST_6( lines<double>() ); } } diff --git a/test/eigen2/inverse.cpp b/test/eigen2/eigen2_inverse.cpp index 9ddc9bb65..aa8b1146a 100644 --- a/test/eigen2/inverse.cpp +++ b/test/eigen2/eigen2_inverse.cpp @@ -65,14 +65,14 @@ template<typename MatrixType> void inverse(const MatrixType& m) VERIFY_IS_APPROX(m1.transpose().inverse(), m1.inverse().transpose()); } -void test_inverse() +void test_eigen2_inverse() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( inverse(Matrix<double,1,1>()) ); - CALL_SUBTEST( inverse(Matrix2d()) ); - CALL_SUBTEST( inverse(Matrix3f()) ); - CALL_SUBTEST( inverse(Matrix4f()) ); - CALL_SUBTEST( inverse(MatrixXf(8,8)) ); - CALL_SUBTEST( inverse(MatrixXcd(7,7)) ); + CALL_SUBTEST_1( inverse(Matrix<double,1,1>()) ); + CALL_SUBTEST_2( inverse(Matrix2d()) ); + CALL_SUBTEST_3( inverse(Matrix3f()) ); + CALL_SUBTEST_4( inverse(Matrix4f()) ); + CALL_SUBTEST_5( inverse(MatrixXf(8,8)) ); + CALL_SUBTEST_6( inverse(MatrixXcd(7,7)) ); } } diff --git a/test/eigen2/linearstructure.cpp b/test/eigen2/eigen2_linearstructure.cpp index f913e6480..0e970df55 100644 --- a/test/eigen2/linearstructure.cpp +++ b/test/eigen2/eigen2_linearstructure.cpp @@ -84,16 +84,16 @@ template<typename MatrixType> void linearStructure(const MatrixType& m) VERIFY_IS_APPROX(m1.block(0,0,rows,cols) * s1, m1 * s1); } -void test_linearstructure() +void test_eigen2_linearstructure() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( linearStructure(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( linearStructure(Matrix2f()) ); - CALL_SUBTEST( linearStructure(Vector3d()) ); - CALL_SUBTEST( linearStructure(Matrix4d()) ); - CALL_SUBTEST( linearStructure(MatrixXcf(3, 3)) ); - CALL_SUBTEST( linearStructure(MatrixXf(8, 12)) ); - CALL_SUBTEST( linearStructure(MatrixXi(8, 12)) ); - CALL_SUBTEST( linearStructure(MatrixXcd(20, 20)) ); + CALL_SUBTEST_1( linearStructure(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( linearStructure(Matrix2f()) ); + CALL_SUBTEST_3( linearStructure(Vector3d()) ); + CALL_SUBTEST_4( linearStructure(Matrix4d()) ); + CALL_SUBTEST_5( linearStructure(MatrixXcf(3, 3)) ); + CALL_SUBTEST_6( linearStructure(MatrixXf(8, 12)) ); + CALL_SUBTEST_7( linearStructure(MatrixXi(8, 12)) ); + CALL_SUBTEST_8( linearStructure(MatrixXcd(20, 20)) ); } } diff --git a/test/eigen2/lu.cpp b/test/eigen2/eigen2_lu.cpp index 51e94870c..fcb375186 100644 --- a/test/eigen2/lu.cpp +++ b/test/eigen2/eigen2_lu.cpp @@ -83,8 +83,10 @@ template<typename MatrixType> void lu_non_invertible() m2 = MatrixType::Random(cols,cols2); lu.solve(m3, &m2); VERIFY_IS_APPROX(m3, m1*m2); + /* solve now always returns true m3 = MatrixType::Random(rows,cols2); VERIFY(!lu.solve(m3, &m2)); + */ } template<typename MatrixType> void lu_invertible() @@ -120,22 +122,16 @@ template<typename MatrixType> void lu_invertible() VERIFY(lu.solve(m3, &m2)); } -void test_lu() +void test_eigen2_lu() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( lu_non_invertible<MatrixXf>() ); - CALL_SUBTEST( lu_non_invertible<MatrixXd>() ); - CALL_SUBTEST( lu_non_invertible<MatrixXcf>() ); - CALL_SUBTEST( lu_non_invertible<MatrixXcd>() ); - CALL_SUBTEST( lu_invertible<MatrixXf>() ); - CALL_SUBTEST( lu_invertible<MatrixXd>() ); - CALL_SUBTEST( lu_invertible<MatrixXcf>() ); - CALL_SUBTEST( lu_invertible<MatrixXcd>() ); + CALL_SUBTEST_1( lu_non_invertible<MatrixXf>() ); + CALL_SUBTEST_2( lu_non_invertible<MatrixXd>() ); + CALL_SUBTEST_3( lu_non_invertible<MatrixXcf>() ); + CALL_SUBTEST_4( lu_non_invertible<MatrixXcd>() ); + CALL_SUBTEST_1( lu_invertible<MatrixXf>() ); + CALL_SUBTEST_2( lu_invertible<MatrixXd>() ); + CALL_SUBTEST_3( lu_invertible<MatrixXcf>() ); + CALL_SUBTEST_4( lu_invertible<MatrixXcd>() ); } - - MatrixXf m = MatrixXf::Zero(10,10); - VectorXf b = VectorXf::Zero(10); - VectorXf x = VectorXf::Random(10); - VERIFY(m.lu().solve(b,&x)); - VERIFY(x.isZero()); } diff --git a/test/eigen2/map.cpp b/test/eigen2/eigen2_map.cpp index 3c51eec16..296902a8f 100644 --- a/test/eigen2/map.cpp +++ b/test/eigen2/eigen2_map.cpp @@ -105,25 +105,25 @@ template<typename VectorType> void map_static_methods(const VectorType& m) } -void test_map() +void test_eigen2_map() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( map_class_vector(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( map_class_vector(Vector4d()) ); - CALL_SUBTEST( map_class_vector(RowVector4f()) ); - CALL_SUBTEST( map_class_vector(VectorXcf(8)) ); - CALL_SUBTEST( map_class_vector(VectorXi(12)) ); + CALL_SUBTEST_1( map_class_vector(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( map_class_vector(Vector4d()) ); + CALL_SUBTEST_3( map_class_vector(RowVector4f()) ); + CALL_SUBTEST_4( map_class_vector(VectorXcf(8)) ); + CALL_SUBTEST_5( map_class_vector(VectorXi(12)) ); - CALL_SUBTEST( map_class_matrix(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( map_class_matrix(Matrix4d()) ); - CALL_SUBTEST( 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( map_class_matrix(MatrixXi(ei_random<int>(1,10),ei_random<int>(1,10))) ); + CALL_SUBTEST_1( map_class_matrix(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( map_class_matrix(Matrix4d()) ); + CALL_SUBTEST_6( map_class_matrix(Matrix<float,3,5>()) ); + CALL_SUBTEST_4( map_class_matrix(MatrixXcf(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( map_static_methods(Vector3f()) ); - CALL_SUBTEST( map_static_methods(RowVector3d()) ); - CALL_SUBTEST( map_static_methods(VectorXcd(8)) ); - CALL_SUBTEST( map_static_methods(VectorXf(12)) ); + CALL_SUBTEST_1( map_static_methods(Matrix<double, 1, 1>()) ); + CALL_SUBTEST_2( map_static_methods(Vector3f()) ); + CALL_SUBTEST_7( map_static_methods(RowVector3d()) ); + CALL_SUBTEST_4( map_static_methods(VectorXcd(8)) ); + CALL_SUBTEST_5( map_static_methods(VectorXf(12)) ); } } diff --git a/test/eigen2/meta.cpp b/test/eigen2/eigen2_meta.cpp index e77e46ba4..4afbafcdf 100644 --- a/test/eigen2/meta.cpp +++ b/test/eigen2/eigen2_meta.cpp @@ -24,7 +24,7 @@ #include "main.h" -void test_meta() +void test_eigen2_meta() { typedef float & FloatRef; typedef const float & ConstFloatRef; diff --git a/test/eigen2/miscmatrices.cpp b/test/eigen2/eigen2_miscmatrices.cpp index 4d2cd4346..95cfa3df9 100644 --- a/test/eigen2/miscmatrices.cpp +++ b/test/eigen2/eigen2_miscmatrices.cpp @@ -51,13 +51,13 @@ template<typename MatrixType> void miscMatrices(const MatrixType& m) VERIFY_IS_APPROX(square, MatrixType::Identity(rows, rows)); } -void test_miscmatrices() +void test_eigen2_miscmatrices() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( miscMatrices(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( miscMatrices(Matrix4d()) ); - CALL_SUBTEST( miscMatrices(MatrixXcf(3, 3)) ); - CALL_SUBTEST( miscMatrices(MatrixXi(8, 12)) ); - CALL_SUBTEST( miscMatrices(MatrixXcd(20, 20)) ); + CALL_SUBTEST_1( miscMatrices(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( miscMatrices(Matrix4d()) ); + CALL_SUBTEST_3( miscMatrices(MatrixXcf(3, 3)) ); + CALL_SUBTEST_4( miscMatrices(MatrixXi(8, 12)) ); + CALL_SUBTEST_5( miscMatrices(MatrixXcd(20, 20)) ); } } diff --git a/test/eigen2/mixingtypes.cpp b/test/eigen2/eigen2_mixingtypes.cpp index ad03639a9..3721a0047 100644 --- a/test/eigen2/mixingtypes.cpp +++ b/test/eigen2/eigen2_mixingtypes.cpp @@ -79,10 +79,10 @@ template<int SizeAtCompileType> void mixingtypes(int size = SizeAtCompileType) VERIFY_RAISES_ASSERT(vcf.dot(vf)); // yeah eventually we should allow this but i'm too lazy to make that change now in Dot.h } // especially as that might be rewritten as cwise product .sum() which would make that automatic. -void test_mixingtypes() +void test_eigen2_mixingtypes() { // check that our operator new is indeed called: - CALL_SUBTEST(mixingtypes<3>()); - CALL_SUBTEST(mixingtypes<4>()); - CALL_SUBTEST(mixingtypes<Dynamic>(20)); + CALL_SUBTEST_1(mixingtypes<3>()); + CALL_SUBTEST_2(mixingtypes<4>()); + CALL_SUBTEST_3(mixingtypes<Dynamic>(20)); } diff --git a/test/eigen2/newstdvector.cpp b/test/eigen2/eigen2_newstdvector.cpp index 5862ee27b..c107f4f8d 100644 --- a/test/eigen2/newstdvector.cpp +++ b/test/eigen2/eigen2_newstdvector.cpp @@ -133,32 +133,32 @@ void check_stdvector_quaternion(const QuaternionType&) } } -void test_newstdvector() +void test_eigen2_newstdvector() { // some non vectorizable fixed sizes - CALL_SUBTEST(check_stdvector_matrix(Vector2f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix3f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix3d())); + CALL_SUBTEST_1(check_stdvector_matrix(Vector2f())); + CALL_SUBTEST_1(check_stdvector_matrix(Matrix3f())); + CALL_SUBTEST_1(check_stdvector_matrix(Matrix3d())); // some vectorizable fixed sizes - CALL_SUBTEST(check_stdvector_matrix(Matrix2f())); - CALL_SUBTEST(check_stdvector_matrix(Vector4f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix4f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix4d())); + CALL_SUBTEST_2(check_stdvector_matrix(Matrix2f())); + CALL_SUBTEST_2(check_stdvector_matrix(Vector4f())); + CALL_SUBTEST_2(check_stdvector_matrix(Matrix4f())); + CALL_SUBTEST_2(check_stdvector_matrix(Matrix4d())); // some dynamic sizes - CALL_SUBTEST(check_stdvector_matrix(MatrixXd(1,1))); - CALL_SUBTEST(check_stdvector_matrix(VectorXd(20))); - CALL_SUBTEST(check_stdvector_matrix(RowVectorXf(20))); - CALL_SUBTEST(check_stdvector_matrix(MatrixXcf(10,10))); + CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1,1))); + CALL_SUBTEST_3(check_stdvector_matrix(VectorXd(20))); + CALL_SUBTEST_3(check_stdvector_matrix(RowVectorXf(20))); + CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10,10))); // some Transform - CALL_SUBTEST(check_stdvector_transform(Transform2f())); - CALL_SUBTEST(check_stdvector_transform(Transform3f())); - CALL_SUBTEST(check_stdvector_transform(Transform3d())); + CALL_SUBTEST_4(check_stdvector_transform(Transform2f())); + CALL_SUBTEST_4(check_stdvector_transform(Transform3f())); + CALL_SUBTEST_4(check_stdvector_transform(Transform3d())); //CALL_SUBTEST(check_stdvector_transform(Transform4d())); // some Quaternion - CALL_SUBTEST(check_stdvector_quaternion(Quaternionf())); - CALL_SUBTEST(check_stdvector_quaternion(Quaterniond())); + CALL_SUBTEST_5(check_stdvector_quaternion(Quaternionf())); + CALL_SUBTEST_5(check_stdvector_quaternion(Quaterniond())); } diff --git a/test/eigen2/nomalloc.cpp b/test/eigen2/eigen2_nomalloc.cpp index 5497ca339..7d28e4cca 100644 --- a/test/eigen2/nomalloc.cpp +++ b/test/eigen2/eigen2_nomalloc.cpp @@ -68,11 +68,11 @@ template<typename MatrixType> void nomalloc(const MatrixType& m) VERIFY_IS_APPROX((m1*m1.transpose())*m2, m1*(m1.transpose()*m2)); } -void test_nomalloc() +void test_eigen2_nomalloc() { // check that our operator new is indeed called: VERIFY_RAISES_ASSERT(MatrixXd dummy = MatrixXd::Random(3,3)); - CALL_SUBTEST( nomalloc(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( nomalloc(Matrix4d()) ); - CALL_SUBTEST( nomalloc(Matrix<float,32,32>()) ); + CALL_SUBTEST_1( nomalloc(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( nomalloc(Matrix4d()) ); + CALL_SUBTEST_3( nomalloc(Matrix<float,32,32>()) ); } diff --git a/test/eigen2/packetmath.cpp b/test/eigen2/eigen2_packetmath.cpp index 6fec9259d..11384b1a8 100644 --- a/test/eigen2/packetmath.cpp +++ b/test/eigen2/eigen2_packetmath.cpp @@ -136,12 +136,12 @@ template<typename Scalar> void packetmath() VERIFY(areApprox(ref, data2, PacketSize) && "ei_preduxp"); } -void test_packetmath() +void test_eigen2_packetmath() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( packetmath<float>() ); - CALL_SUBTEST( packetmath<double>() ); - CALL_SUBTEST( packetmath<int>() ); - CALL_SUBTEST( packetmath<std::complex<float> >() ); + CALL_SUBTEST_1( packetmath<float>() ); + CALL_SUBTEST_2( packetmath<double>() ); + CALL_SUBTEST_3( packetmath<int>() ); + CALL_SUBTEST_4( packetmath<std::complex<float> >() ); } } diff --git a/test/eigen2/parametrizedline.cpp b/test/eigen2/eigen2_parametrizedline.cpp index 4444432a6..a301be815 100644 --- a/test/eigen2/parametrizedline.cpp +++ b/test/eigen2/eigen2_parametrizedline.cpp @@ -66,12 +66,12 @@ template<typename LineType> void parametrizedline(const LineType& _line) VERIFY_IS_APPROX(hp1d.template cast<Scalar>(),l0); } -void test_parametrizedline() +void test_eigen2_parametrizedline() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( parametrizedline(ParametrizedLine<float,2>()) ); - CALL_SUBTEST( parametrizedline(ParametrizedLine<float,3>()) ); - CALL_SUBTEST( parametrizedline(ParametrizedLine<double,4>()) ); - CALL_SUBTEST( parametrizedline(ParametrizedLine<std::complex<double>,5>()) ); + CALL_SUBTEST_1( parametrizedline(ParametrizedLine<float,2>()) ); + CALL_SUBTEST_2( parametrizedline(ParametrizedLine<float,3>()) ); + CALL_SUBTEST_3( parametrizedline(ParametrizedLine<double,4>()) ); + CALL_SUBTEST_4( parametrizedline(ParametrizedLine<std::complex<double>,5>()) ); } } diff --git a/test/eigen2/prec_inverse_4x4.cpp b/test/eigen2/eigen2_prec_inverse_4x4.cpp index 762c8ea32..5117c8095 100644 --- a/test/eigen2/prec_inverse_4x4.cpp +++ b/test/eigen2/eigen2_prec_inverse_4x4.cpp @@ -86,14 +86,14 @@ template<typename MatrixType> void inverse_general_4x4(int repeat) VERIFY(error_max < (NumTraits<Scalar>::IsComplex ? 64.0 : 20.0)); } -void test_prec_inverse_4x4() +void test_eigen2_prec_inverse_4x4() { - CALL_SUBTEST((inverse_permutation_4x4<Matrix4f>())); - CALL_SUBTEST(( inverse_general_4x4<Matrix4f>(200000 * g_repeat) )); + CALL_SUBTEST_1((inverse_permutation_4x4<Matrix4f>())); + CALL_SUBTEST_1(( inverse_general_4x4<Matrix4f>(200000 * g_repeat) )); - CALL_SUBTEST((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_permutation_4x4<Matrix<double,4,4,RowMajor> >())); + CALL_SUBTEST_2(( inverse_general_4x4<Matrix<double,4,4,RowMajor> >(200000 * g_repeat) )); - CALL_SUBTEST((inverse_permutation_4x4<Matrix4cf>())); - CALL_SUBTEST((inverse_general_4x4<Matrix4cf>(50000 * g_repeat))); + CALL_SUBTEST_3((inverse_permutation_4x4<Matrix4cf>())); + CALL_SUBTEST_3((inverse_general_4x4<Matrix4cf>(50000 * g_repeat))); } diff --git a/test/eigen2/product_large.cpp b/test/eigen2/eigen2_product_large.cpp index 966d8ed76..0ecc5d623 100644 --- a/test/eigen2/product_large.cpp +++ b/test/eigen2/eigen2_product_large.cpp @@ -24,16 +24,17 @@ #include "product.h" -void test_product_large() +void test_eigen2_product_large() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( 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( 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( product(Matrix<float,Dynamic,Dynamic,RowMajor>(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_2( product(MatrixXd(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_4( product(MatrixXcf(ei_random<int>(1,50), ei_random<int>(1,50))) ); + 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 int N = 1000000; @@ -55,4 +56,5 @@ void test_product_large() MatrixXf result = mat1.row(2)*mat2.transpose(); VERIFY_IS_APPROX(result, (mat1.row(2)*mat2.transpose()).eval()); } +#endif } diff --git a/test/eigen2/product_small.cpp b/test/eigen2/eigen2_product_small.cpp index 1845c2c73..2a445d12a 100644 --- a/test/eigen2/product_small.cpp +++ b/test/eigen2/eigen2_product_small.cpp @@ -25,13 +25,13 @@ #define EIGEN_NO_STATIC_ASSERT #include "product.h" -void test_product_small() +void test_eigen2_product_small() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( product(Matrix<float, 3, 2>()) ); - CALL_SUBTEST( product(Matrix<int, 3, 5>()) ); - CALL_SUBTEST( product(Matrix3d()) ); - CALL_SUBTEST( product(Matrix4d()) ); - CALL_SUBTEST( product(Matrix4f()) ); + CALL_SUBTEST_1( product(Matrix<float, 3, 2>()) ); + CALL_SUBTEST_2( product(Matrix<int, 3, 5>()) ); + CALL_SUBTEST_3( product(Matrix3d()) ); + CALL_SUBTEST_4( product(Matrix4d()) ); + CALL_SUBTEST_5( product(Matrix4f()) ); } } diff --git a/test/eigen2/qr.cpp b/test/eigen2/eigen2_qr.cpp index 877945731..e6231208d 100644 --- a/test/eigen2/qr.cpp +++ b/test/eigen2/eigen2_qr.cpp @@ -42,6 +42,7 @@ template<typename MatrixType> void qr(const MatrixType& m) VERIFY_IS_APPROX(a, qrOfA.matrixQ() * qrOfA.matrixR()); VERIFY_IS_NOT_APPROX(a+MatrixType::Identity(rows, cols), qrOfA.matrixQ() * qrOfA.matrixR()); + #if 0 // eigenvalues module not yet ready SquareMatrixType b = a.adjoint() * a; // check tridiagonalization @@ -55,31 +56,29 @@ template<typename MatrixType> void qr(const MatrixType& m) b = SquareMatrixType::Random(cols,cols); hess.compute(b); VERIFY_IS_APPROX(b, hess.matrixQ() * hess.matrixH() * hess.matrixQ().adjoint()); + #endif } -void test_qr() +void test_eigen2_qr() { for(int i = 0; i < 1; i++) { - CALL_SUBTEST( qr(Matrix2f()) ); - CALL_SUBTEST( qr(Matrix4d()) ); - CALL_SUBTEST( qr(MatrixXf(12,8)) ); - CALL_SUBTEST( qr(MatrixXcd(5,5)) ); - CALL_SUBTEST( qr(MatrixXcd(7,3)) ); + CALL_SUBTEST_1( qr(Matrix2f()) ); + CALL_SUBTEST_2( qr(Matrix4d()) ); + CALL_SUBTEST_3( qr(MatrixXf(12,8)) ); + CALL_SUBTEST_4( qr(MatrixXcd(5,5)) ); + CALL_SUBTEST_4( qr(MatrixXcd(7,3)) ); } +#ifdef EIGEN_TEST_PART_5 // small isFullRank test { Matrix3d mat; mat << 1, 45, 1, 2, 2, 2, 1, 2, 3; VERIFY(mat.qr().isFullRank()); mat << 1, 1, 1, 2, 2, 2, 1, 2, 3; - VERIFY(!mat.qr().isFullRank()); - } - { - MatrixXf m = MatrixXf::Zero(10,10); - VectorXf b = VectorXf::Zero(10); - VectorXf x = VectorXf::Random(10); - VERIFY(m.qr().solve(b,&x)); - VERIFY(x.isZero()); + //always returns true in eigen2support + //VERIFY(!mat.qr().isFullRank()); } + +#endif } diff --git a/test/eigen2/qtvector.cpp b/test/eigen2/eigen2_qtvector.cpp index 79c55b631..8c4446637 100644 --- a/test/eigen2/qtvector.cpp +++ b/test/eigen2/eigen2_qtvector.cpp @@ -142,32 +142,32 @@ void check_qtvector_quaternion(const QuaternionType&) } } -void test_qtvector() +void test_eigen2_qtvector() { // some non vectorizable fixed sizes - CALL_SUBTEST(check_qtvector_matrix(Vector2f())); - CALL_SUBTEST(check_qtvector_matrix(Matrix3f())); - CALL_SUBTEST(check_qtvector_matrix(Matrix3d())); + CALL_SUBTEST_1(check_qtvector_matrix(Vector2f())); + CALL_SUBTEST_1(check_qtvector_matrix(Matrix3f())); + CALL_SUBTEST_1(check_qtvector_matrix(Matrix3d())); // some vectorizable fixed sizes - CALL_SUBTEST(check_qtvector_matrix(Matrix2f())); - CALL_SUBTEST(check_qtvector_matrix(Vector4f())); - CALL_SUBTEST(check_qtvector_matrix(Matrix4f())); - CALL_SUBTEST(check_qtvector_matrix(Matrix4d())); + CALL_SUBTEST_2(check_qtvector_matrix(Matrix2f())); + CALL_SUBTEST_2(check_qtvector_matrix(Vector4f())); + CALL_SUBTEST_2(check_qtvector_matrix(Matrix4f())); + CALL_SUBTEST_2(check_qtvector_matrix(Matrix4d())); // some dynamic sizes - CALL_SUBTEST(check_qtvector_matrix(MatrixXd(1,1))); - CALL_SUBTEST(check_qtvector_matrix(VectorXd(20))); - CALL_SUBTEST(check_qtvector_matrix(RowVectorXf(20))); - CALL_SUBTEST(check_qtvector_matrix(MatrixXcf(10,10))); + CALL_SUBTEST_3(check_qtvector_matrix(MatrixXd(1,1))); + CALL_SUBTEST_3(check_qtvector_matrix(VectorXd(20))); + CALL_SUBTEST_3(check_qtvector_matrix(RowVectorXf(20))); + CALL_SUBTEST_3(check_qtvector_matrix(MatrixXcf(10,10))); // some Transform - CALL_SUBTEST(check_qtvector_transform(Transform2f())); - CALL_SUBTEST(check_qtvector_transform(Transform3f())); - CALL_SUBTEST(check_qtvector_transform(Transform3d())); - //CALL_SUBTEST(check_qtvector_transform(Transform4d())); + CALL_SUBTEST_4(check_qtvector_transform(Transform2f())); + CALL_SUBTEST_4(check_qtvector_transform(Transform3f())); + CALL_SUBTEST_4(check_qtvector_transform(Transform3d())); + //CALL_SUBTEST_4(check_qtvector_transform(Transform4d())); // some Quaternion - CALL_SUBTEST(check_qtvector_quaternion(Quaternionf())); - CALL_SUBTEST(check_qtvector_quaternion(Quaternionf())); + CALL_SUBTEST_5(check_qtvector_quaternion(Quaternionf())); + CALL_SUBTEST_5(check_qtvector_quaternion(Quaternionf())); } diff --git a/test/eigen2/regression.cpp b/test/eigen2/eigen2_regression.cpp index 534ad3d1c..9bc41de87 100644 --- a/test/eigen2/regression.cpp +++ b/test/eigen2/eigen2_regression.cpp @@ -91,10 +91,11 @@ void check_fitHyperplane(int numPoints, VERIFY(ei_abs(error) < ei_abs(tolerance)); } -void test_regression() +void test_eigen2_regression() { for(int i = 0; i < g_repeat; i++) { +#ifdef EIGEN_TEST_PART_1 { Vector2f points2f [1000]; Vector2f *points2f_ptrs [1000]; @@ -108,7 +109,8 @@ void test_regression() CALL_SUBTEST(check_linearRegression(100, points2f_ptrs, coeffs2f, 0.01f)); CALL_SUBTEST(check_linearRegression(1000, points2f_ptrs, coeffs2f, 0.002f)); } - +#endif +#ifdef EIGEN_TEST_PART_2 { Vector2f points2f [1000]; Vector2f *points2f_ptrs [1000]; @@ -119,7 +121,8 @@ void test_regression() CALL_SUBTEST(check_fitHyperplane(100, points2f_ptrs, coeffs3f, 0.01f)); CALL_SUBTEST(check_fitHyperplane(1000, points2f_ptrs, coeffs3f, 0.002f)); } - +#endif +#ifdef EIGEN_TEST_PART_3 { Vector4d points4d [1000]; Vector4d *points4d_ptrs [1000]; @@ -130,7 +133,8 @@ void test_regression() CALL_SUBTEST(check_fitHyperplane(100, points4d_ptrs, coeffs5d, 0.01)); CALL_SUBTEST(check_fitHyperplane(1000, points4d_ptrs, coeffs5d, 0.002)); } - +#endif +#ifdef EIGEN_TEST_PART_4 { VectorXcd *points11cd_ptrs[1000]; for(int i = 0; i < 1000; i++) points11cd_ptrs[i] = new VectorXcd(11); @@ -141,5 +145,6 @@ void test_regression() delete coeffs12cd; for(int i = 0; i < 1000; i++) delete points11cd_ptrs[i]; } +#endif } } diff --git a/test/eigen2/sizeof.cpp b/test/eigen2/eigen2_sizeof.cpp index 6ccb2330c..73ed533e0 100644 --- a/test/eigen2/sizeof.cpp +++ b/test/eigen2/eigen2_sizeof.cpp @@ -33,7 +33,7 @@ template<typename MatrixType> void verifySizeOf(const MatrixType&) VERIFY(sizeof(MatrixType)==sizeof(Scalar*) + 2 * sizeof(typename MatrixType::Index)); } -void test_sizeof() +void test_eigen2_sizeof() { CALL_SUBTEST( verifySizeOf(Matrix<float, 1, 1>()) ); CALL_SUBTEST( verifySizeOf(Matrix4d()) ); diff --git a/test/eigen2/smallvectors.cpp b/test/eigen2/eigen2_smallvectors.cpp index eed30d99e..163c3e653 100644 --- a/test/eigen2/smallvectors.cpp +++ b/test/eigen2/eigen2_smallvectors.cpp @@ -47,7 +47,7 @@ template<typename Scalar> void smallVectors() VERIFY_IS_APPROX(x4, v4.w()); } -void test_smallvectors() +void test_eigen2_smallvectors() { for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST( smallVectors<int>() ); diff --git a/test/eigen2/sparse_basic.cpp b/test/eigen2/eigen2_sparse_basic.cpp index 410ef96a6..4e9f8e9f2 100644 --- a/test/eigen2/sparse_basic.cpp +++ b/test/eigen2/eigen2_sparse_basic.cpp @@ -320,13 +320,13 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re } } -void test_sparse_basic() +void test_eigen2_sparse_basic() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( sparse_basic(SparseMatrix<double>(8, 8)) ); - CALL_SUBTEST( sparse_basic(SparseMatrix<std::complex<double> >(16, 16)) ); - CALL_SUBTEST( sparse_basic(SparseMatrix<double>(33, 33)) ); + CALL_SUBTEST_1( sparse_basic(SparseMatrix<double>(8, 8)) ); + CALL_SUBTEST_2( sparse_basic(SparseMatrix<std::complex<double> >(16, 16)) ); + 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)) ); } } diff --git a/test/eigen2/sparse_product.cpp b/test/eigen2/eigen2_sparse_product.cpp index dcfc58a14..6260cdddb 100644 --- a/test/eigen2/sparse_product.cpp +++ b/test/eigen2/eigen2_sparse_product.cpp @@ -118,13 +118,13 @@ template<typename SparseMatrixType> void sparse_product(const SparseMatrixType& } -void test_sparse_product() +void test_eigen2_sparse_product() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( sparse_product(SparseMatrix<double>(8, 8)) ); - CALL_SUBTEST( sparse_product(SparseMatrix<std::complex<double> >(16, 16)) ); - CALL_SUBTEST( sparse_product(SparseMatrix<double>(33, 33)) ); + CALL_SUBTEST_1( sparse_product(SparseMatrix<double>(8, 8)) ); + CALL_SUBTEST_2( sparse_product(SparseMatrix<std::complex<double> >(16, 16)) ); + 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)) ); } } diff --git a/test/eigen2/sparse_solvers.cpp b/test/eigen2/eigen2_sparse_solvers.cpp index 3d7f5b91e..f141af314 100644 --- a/test/eigen2/sparse_solvers.cpp +++ b/test/eigen2/eigen2_sparse_solvers.cpp @@ -205,11 +205,11 @@ template<typename Scalar> void sparse_solvers(int rows, int cols) } -void test_sparse_solvers() +void test_eigen2_sparse_solvers() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( sparse_solvers<double>(8, 8) ); - CALL_SUBTEST( sparse_solvers<std::complex<double> >(16, 16) ); - CALL_SUBTEST( sparse_solvers<double>(101, 101) ); + CALL_SUBTEST_1( sparse_solvers<double>(8, 8) ); + CALL_SUBTEST_2( sparse_solvers<std::complex<double> >(16, 16) ); + CALL_SUBTEST_1( sparse_solvers<double>(101, 101) ); } } diff --git a/test/eigen2/sparse_vector.cpp b/test/eigen2/eigen2_sparse_vector.cpp index 934719f2c..3289cbd20 100644 --- a/test/eigen2/sparse_vector.cpp +++ b/test/eigen2/eigen2_sparse_vector.cpp @@ -88,12 +88,12 @@ template<typename Scalar> void sparse_vector(int rows, int cols) } -void test_sparse_vector() +void test_eigen2_sparse_vector() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( sparse_vector<double>(8, 8) ); - CALL_SUBTEST( sparse_vector<std::complex<double> >(16, 16) ); - CALL_SUBTEST( sparse_vector<double>(299, 535) ); + CALL_SUBTEST_1( sparse_vector<double>(8, 8) ); + CALL_SUBTEST_2( sparse_vector<std::complex<double> >(16, 16) ); + CALL_SUBTEST_1( sparse_vector<double>(299, 535) ); } } diff --git a/test/eigen2/stdvector.cpp b/test/eigen2/eigen2_stdvector.cpp index 8d205f310..46d0bf7dc 100644 --- a/test/eigen2/stdvector.cpp +++ b/test/eigen2/eigen2_stdvector.cpp @@ -132,32 +132,32 @@ void check_stdvector_quaternion(const QuaternionType&) } } -void test_stdvector() +void test_eigen2_stdvector() { // some non vectorizable fixed sizes - CALL_SUBTEST(check_stdvector_matrix(Vector2f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix3f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix3d())); + CALL_SUBTEST_1(check_stdvector_matrix(Vector2f())); + CALL_SUBTEST_1(check_stdvector_matrix(Matrix3f())); + CALL_SUBTEST_1(check_stdvector_matrix(Matrix3d())); // some vectorizable fixed sizes - CALL_SUBTEST(check_stdvector_matrix(Matrix2f())); - CALL_SUBTEST(check_stdvector_matrix(Vector4f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix4f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix4d())); + CALL_SUBTEST_2(check_stdvector_matrix(Matrix2f())); + CALL_SUBTEST_2(check_stdvector_matrix(Vector4f())); + CALL_SUBTEST_2(check_stdvector_matrix(Matrix4f())); + CALL_SUBTEST_2(check_stdvector_matrix(Matrix4d())); // some dynamic sizes - CALL_SUBTEST(check_stdvector_matrix(MatrixXd(1,1))); - CALL_SUBTEST(check_stdvector_matrix(VectorXd(20))); - CALL_SUBTEST(check_stdvector_matrix(RowVectorXf(20))); - CALL_SUBTEST(check_stdvector_matrix(MatrixXcf(10,10))); + CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1,1))); + CALL_SUBTEST_3(check_stdvector_matrix(VectorXd(20))); + CALL_SUBTEST_3(check_stdvector_matrix(RowVectorXf(20))); + CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10,10))); // some Transform - CALL_SUBTEST(check_stdvector_transform(Transform2f())); - CALL_SUBTEST(check_stdvector_transform(Transform3f())); - CALL_SUBTEST(check_stdvector_transform(Transform3d())); - //CALL_SUBTEST(check_stdvector_transform(Transform4d())); + CALL_SUBTEST_4(check_stdvector_transform(Transform2f())); + CALL_SUBTEST_4(check_stdvector_transform(Transform3f())); + CALL_SUBTEST_4(check_stdvector_transform(Transform3d())); + //CALL_SUBTEST_4(check_stdvector_transform(Transform4d())); // some Quaternion - CALL_SUBTEST(check_stdvector_quaternion(Quaternionf())); - CALL_SUBTEST(check_stdvector_quaternion(Quaternionf())); + CALL_SUBTEST_5(check_stdvector_quaternion(Quaternionf())); + CALL_SUBTEST_5(check_stdvector_quaternion(Quaternionf())); } diff --git a/test/eigen2/submatrices.cpp b/test/eigen2/eigen2_submatrices.cpp index 71bb65482..37a084286 100644 --- a/test/eigen2/submatrices.cpp +++ b/test/eigen2/eigen2_submatrices.cpp @@ -150,14 +150,14 @@ template<typename MatrixType> void submatrices(const MatrixType& m) VERIFY(ei_real(ones.row(r1).dot(ones.row(r2))) == RealScalar(cols)); } -void test_submatrices() +void test_eigen2_submatrices() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( submatrices(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( submatrices(Matrix4d()) ); - CALL_SUBTEST( submatrices(MatrixXcf(3, 3)) ); - CALL_SUBTEST( submatrices(MatrixXi(8, 12)) ); - CALL_SUBTEST( submatrices(MatrixXcd(20, 20)) ); - CALL_SUBTEST( submatrices(MatrixXf(20, 20)) ); + CALL_SUBTEST_1( submatrices(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( submatrices(Matrix4d()) ); + CALL_SUBTEST_3( submatrices(MatrixXcf(3, 3)) ); + CALL_SUBTEST_4( submatrices(MatrixXi(8, 12)) ); + CALL_SUBTEST_5( submatrices(MatrixXcd(20, 20)) ); + CALL_SUBTEST_6( submatrices(MatrixXf(20, 20)) ); } } diff --git a/test/eigen2/sum.cpp b/test/eigen2/eigen2_sum.cpp index fe707e9b2..aabf49c22 100644 --- a/test/eigen2/sum.cpp +++ b/test/eigen2/eigen2_sum.cpp @@ -68,19 +68,19 @@ template<typename VectorType> void vectorSum(const VectorType& w) } } -void test_sum() +void test_eigen2_sum() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( matrixSum(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( matrixSum(Matrix2f()) ); - CALL_SUBTEST( matrixSum(Matrix4d()) ); - CALL_SUBTEST( matrixSum(MatrixXcf(3, 3)) ); - CALL_SUBTEST( matrixSum(MatrixXf(8, 12)) ); - CALL_SUBTEST( matrixSum(MatrixXi(8, 12)) ); + CALL_SUBTEST_1( matrixSum(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( matrixSum(Matrix2f()) ); + CALL_SUBTEST_3( matrixSum(Matrix4d()) ); + CALL_SUBTEST_4( matrixSum(MatrixXcf(3, 3)) ); + CALL_SUBTEST_5( matrixSum(MatrixXf(8, 12)) ); + CALL_SUBTEST_6( matrixSum(MatrixXi(8, 12)) ); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( vectorSum(VectorXf(5)) ); - CALL_SUBTEST( vectorSum(VectorXd(10)) ); - CALL_SUBTEST( vectorSum(VectorXf(33)) ); + CALL_SUBTEST_5( vectorSum(VectorXf(5)) ); + CALL_SUBTEST_7( vectorSum(VectorXd(10)) ); + CALL_SUBTEST_5( vectorSum(VectorXf(33)) ); } } diff --git a/test/eigen2/svd.cpp b/test/eigen2/eigen2_svd.cpp index 3158782d8..f74b13ea7 100644 --- a/test/eigen2/svd.cpp +++ b/test/eigen2/eigen2_svd.cpp @@ -85,13 +85,13 @@ template<typename MatrixType> void svd(const MatrixType& m) } } -void test_svd() +void test_eigen2_svd() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( svd(Matrix3f()) ); - CALL_SUBTEST( svd(Matrix4d()) ); - CALL_SUBTEST( svd(MatrixXf(7,7)) ); - CALL_SUBTEST( svd(MatrixXd(14,7)) ); + CALL_SUBTEST_1( svd(Matrix3f()) ); + CALL_SUBTEST_2( svd(Matrix4d()) ); + CALL_SUBTEST_3( svd(MatrixXf(7,7)) ); + CALL_SUBTEST_4( svd(MatrixXd(14,7)) ); // complex are not implemented yet // CALL_SUBTEST( svd(MatrixXcd(6,6)) ); // CALL_SUBTEST( svd(MatrixXcf(3,3)) ); diff --git a/test/eigen2/swap.cpp b/test/eigen2/eigen2_swap.cpp index 8b325992c..29688bd33 100644 --- a/test/eigen2/swap.cpp +++ b/test/eigen2/eigen2_swap.cpp @@ -89,10 +89,10 @@ template<typename MatrixType> void swap(const MatrixType& m) VERIFY_RAISES_ASSERT(m1.row(0).swap(m1)); } -void test_swap() +void test_eigen2_swap() { - CALL_SUBTEST( swap(Matrix3f()) ); // fixed size, no vectorization - CALL_SUBTEST( swap(Matrix4d()) ); // fixed size, possible vectorization - CALL_SUBTEST( swap(MatrixXd(3,3)) ); // dyn size, no vectorization - CALL_SUBTEST( swap(MatrixXf(30,30)) ); // dyn size, possible vectorization + CALL_SUBTEST( swap_1(Matrix3f()) ); // fixed size, no vectorization + CALL_SUBTEST( swap_2(Matrix4d()) ); // fixed size, possible vectorization + CALL_SUBTEST( swap_3(MatrixXd(3,3)) ); // dyn size, no vectorization + CALL_SUBTEST( swap_4(MatrixXf(30,30)) ); // dyn size, possible vectorization } diff --git a/test/eigen2/triangular.cpp b/test/eigen2/eigen2_triangular.cpp index a74ca5e0b..30ef1b20b 100644 --- a/test/eigen2/triangular.cpp +++ b/test/eigen2/eigen2_triangular.cpp @@ -124,15 +124,50 @@ template<typename MatrixType> void triangular(const MatrixType& m) } -void test_triangular() +void selfadjoint() { + Matrix2i m; + m << 1, 2, + 3, 4; + + Matrix2i m1 = Matrix2i::Zero(); + m1.part<SelfAdjoint>() = m; + Matrix2i ref1; + ref1 << 1, 2, + 2, 4; + VERIFY(m1 == ref1); + + Matrix2i m2 = Matrix2i::Zero(); + m2.part<SelfAdjoint>() = m.part<UpperTriangular>(); + Matrix2i ref2; + ref2 << 1, 2, + 2, 4; + VERIFY(m2 == ref2); + + Matrix2i m3 = Matrix2i::Zero(); + m3.part<SelfAdjoint>() = m.part<LowerTriangular>(); + Matrix2i ref3; + ref3 << 1, 0, + 0, 4; + VERIFY(m3 == ref3); + + // example inspired from bug 159 + int array[] = {1, 2, 3, 4}; + Matrix2i::Map(array).part<SelfAdjoint>() = Matrix2i::Random().part<LowerTriangular>(); + + std::cout << "hello\n" << array << std::endl; +} + +void test_eigen2_triangular() +{ + CALL_SUBTEST_8( selfadjoint() ); for(int i = 0; i < g_repeat ; i++) { - CALL_SUBTEST( triangular(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( triangular(Matrix<float, 2, 2>()) ); - CALL_SUBTEST( triangular(Matrix3d()) ); - CALL_SUBTEST( triangular(MatrixXcf(4, 4)) ); - CALL_SUBTEST( triangular(Matrix<std::complex<float>,8, 8>()) ); - CALL_SUBTEST( triangular(MatrixXd(17,17)) ); - CALL_SUBTEST( triangular(Matrix<float,Dynamic,Dynamic,RowMajor>(5, 5)) ); + CALL_SUBTEST_1( triangular(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( triangular(Matrix<float, 2, 2>()) ); + CALL_SUBTEST_3( triangular(Matrix3d()) ); + CALL_SUBTEST_4( triangular(MatrixXcf(4, 4)) ); + CALL_SUBTEST_5( triangular(Matrix<std::complex<float>,8, 8>()) ); + CALL_SUBTEST_6( triangular(MatrixXd(17,17)) ); + CALL_SUBTEST_7( triangular(Matrix<float,Dynamic,Dynamic,RowMajor>(5, 5)) ); } } diff --git a/test/eigen2/unalignedassert.cpp b/test/eigen2/eigen2_unalignedassert.cpp index cf6f1bdf6..80dd1188c 100644 --- a/test/eigen2/unalignedassert.cpp +++ b/test/eigen2/eigen2_unalignedassert.cpp @@ -125,7 +125,7 @@ void unalignedassert() #endif } -void test_unalignedassert() +void test_eigen2_unalignedassert() { CALL_SUBTEST(unalignedassert()); } diff --git a/test/eigen2/visitor.cpp b/test/eigen2/eigen2_visitor.cpp index 6ec442bc8..db650b73d 100644 --- a/test/eigen2/visitor.cpp +++ b/test/eigen2/eigen2_visitor.cpp @@ -112,20 +112,20 @@ template<typename VectorType> void vectorVisitor(const VectorType& w) VERIFY_IS_APPROX(maxc, v.maxCoeff()); } -void test_visitor() +void test_eigen2_visitor() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( matrixVisitor(Matrix<float, 1, 1>()) ); - CALL_SUBTEST( matrixVisitor(Matrix2f()) ); - CALL_SUBTEST( matrixVisitor(Matrix4d()) ); - CALL_SUBTEST( matrixVisitor(MatrixXd(8, 12)) ); - CALL_SUBTEST( matrixVisitor(Matrix<double,Dynamic,Dynamic,RowMajor>(20, 20)) ); - CALL_SUBTEST( matrixVisitor(MatrixXi(8, 12)) ); + CALL_SUBTEST_1( matrixVisitor(Matrix<float, 1, 1>()) ); + CALL_SUBTEST_2( matrixVisitor(Matrix2f()) ); + CALL_SUBTEST_3( matrixVisitor(Matrix4d()) ); + CALL_SUBTEST_4( matrixVisitor(MatrixXd(8, 12)) ); + CALL_SUBTEST_5( matrixVisitor(Matrix<double,Dynamic,Dynamic,RowMajor>(20, 20)) ); + CALL_SUBTEST_6( matrixVisitor(MatrixXi(8, 12)) ); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( vectorVisitor(Vector4f()) ); - CALL_SUBTEST( vectorVisitor(VectorXd(10)) ); - CALL_SUBTEST( vectorVisitor(RowVectorXd(10)) ); - CALL_SUBTEST( vectorVisitor(VectorXf(33)) ); + CALL_SUBTEST_7( vectorVisitor(Vector4f()) ); + CALL_SUBTEST_4( vectorVisitor(VectorXd(10)) ); + CALL_SUBTEST_4( vectorVisitor(RowVectorXd(10)) ); + CALL_SUBTEST_8( vectorVisitor(VectorXf(33)) ); } } diff --git a/test/eigen2/main.h b/test/eigen2/main.h index e144a28b1..5b6c715e7 100644 --- a/test/eigen2/main.h +++ b/test/eigen2/main.h @@ -240,6 +240,104 @@ void EI_PP_CAT(test_,EIGEN_TEST_FUNC)(); 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[]) { bool has_set_repeat = false; diff --git a/test/selfadjoint.cpp b/test/selfadjoint.cpp index a92ad96b5..622045f20 100644 --- a/test/selfadjoint.cpp +++ b/test/selfadjoint.cpp @@ -52,6 +52,11 @@ template<typename MatrixType> void selfadjoint(const MatrixType& m) VERIFY_IS_APPROX(m3, m3.adjoint()); } +void bug_159() +{ + Matrix3d m = Matrix3d::Random().selfadjointView<Lower>(); +} + void test_selfadjoint() { for(int i = 0; i < g_repeat ; i++) @@ -64,4 +69,6 @@ void test_selfadjoint() CALL_SUBTEST_4( selfadjoint(MatrixXcd(s,s)) ); CALL_SUBTEST_5( selfadjoint(Matrix<float,Dynamic,Dynamic,RowMajor>(s, s)) ); } + + CALL_SUBTEST_1( bug_159() ); } diff --git a/test/triangular.cpp b/test/triangular.cpp index 0c69749e0..69decb793 100644 --- a/test/triangular.cpp +++ b/test/triangular.cpp @@ -235,6 +235,11 @@ template<typename MatrixType> void triangular_rect(const MatrixType& m) VERIFY_IS_APPROX(m2,m3); } +void bug_159() +{ + Matrix3d m = Matrix3d::Random().triangularView<Lower>(); +} + void test_triangular() { for(int i = 0; i < g_repeat ; i++) @@ -255,4 +260,6 @@ void test_triangular() CALL_SUBTEST_5( triangular_rect(MatrixXcd(r, c)) ); CALL_SUBTEST_6( triangular_rect(Matrix<float,Dynamic,Dynamic,RowMajor>(r, c)) ); } + + CALL_SUBTEST_1( bug_159() ); } |