mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-03 10:14:04 +08:00
kill ei_add_test_multi. Now the macro ei_add_test does all that automatically, by parsing the source file. No risk anymore to specify the wrong number of tests! Also, introduce CALL_SUBTESTX for X=1..10 that allows to port existing code much quicker. And port already the product* and eigensolver* files.
This commit is contained in:
parent
580672ea43
commit
6c1b91678b
@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
option(EIGEN_NO_ASSERTION_CHECKING "Disable checking of assertions" OFF)
|
||||
|
||||
# similar to set_target_properties but append the property instead of overwriting it
|
||||
@ -118,6 +116,10 @@ endmacro(ei_add_test_internal)
|
||||
# #include "main.h"
|
||||
# void test_<testname>() { ... }
|
||||
#
|
||||
# Depending on the contents of that file, this macro can have 2 behaviors.
|
||||
#
|
||||
# A. Default behavior
|
||||
#
|
||||
# this macro add an executable test_<testname> as well as a ctest test
|
||||
# named <testname>.
|
||||
#
|
||||
@ -129,50 +131,60 @@ endmacro(ei_add_test_internal)
|
||||
# "ctest -V" or "ctest -V -R <testname>"
|
||||
# On other platform use ctest as usual
|
||||
#
|
||||
# B. Multi-part behavior
|
||||
#
|
||||
# If the source file matches the regexp
|
||||
# CALL_SUBTEST[0-9]+|EIGEN_TEST_PART_[0-9]+
|
||||
# then it is interpreted as a multi-part test. The behavior then depends on the
|
||||
# CMake option EIGEN_SPLIT_LARGE_TESTS, which is ON by default.
|
||||
#
|
||||
# If EIGEN_SPLIT_LARGE_TESTS is OFF, the behavior is the same as in A (the multi-part
|
||||
# aspect is ignored).
|
||||
#
|
||||
# If EIGEN_SPLIT_LARGE_TESTS is ON, the test is split into multiple executables
|
||||
# test_<testname>_<N>
|
||||
# where N runs from 1 to the greatest occurence found in the source file. Each of these
|
||||
# executables is built passing -DEIGEN_TEST_PART_N. This allows to split large tests
|
||||
# into smaller executables.
|
||||
#
|
||||
# The same holds for the debug executables.
|
||||
#
|
||||
# Moreover, targets test_<testname> and debug_<testname> are still generated, they
|
||||
# have the effect of building all the parts of the test.
|
||||
#
|
||||
# Again, ctest -R allows to run all matching tests.
|
||||
#
|
||||
macro(ei_add_test testname)
|
||||
ei_add_test_internal(${testname} ${testname} "${ARGV1}" "${ARGV2}")
|
||||
endmacro(ei_add_test)
|
||||
|
||||
# Macro to add a multi-part test. Allows to split large tests into multiple executables.
|
||||
#
|
||||
# The first parameter is the number of parts.
|
||||
#
|
||||
# the second parameter testname must correspond to a file
|
||||
# <testname>.cpp which follows this pattern:
|
||||
#
|
||||
# #include "main.h"
|
||||
# void test_<testname>() { ... }
|
||||
#
|
||||
# this macro adds executables test_<testname>_N for N ranging from 1 to the number of parts
|
||||
# (first parameter) as well as corresponding ctest tests named <testname_N>.
|
||||
#
|
||||
# it also adds corresponding debug targets and ctest tests, see the documentation of ei_add_test.
|
||||
#
|
||||
# On platforms with bash simply run:
|
||||
# "ctest -V" or "ctest -V -R <testname>"
|
||||
# On other platforms use ctest as usual
|
||||
macro(ei_add_test_multi parts testname)
|
||||
if(EIGEN_SPLIT_LARGE_TESTS)
|
||||
file(READ "${testname}.cpp" test_source)
|
||||
set(parts 0)
|
||||
string(REGEX MATCHALL "CALL_SUBTEST[0-9]+|EIGEN_TEST_PART_[0-9]+" occurences "${test_source}")
|
||||
foreach(occurence ${occurences})
|
||||
string(REGEX MATCH "([0-9]+)" _number_in_occurence "${occurence}")
|
||||
set(number ${CMAKE_MATCH_1})
|
||||
if(${number} GREATER ${parts})
|
||||
set(parts ${number})
|
||||
endif(${number} GREATER ${parts})
|
||||
endforeach(occurence)
|
||||
if(EIGEN_SPLIT_LARGE_TESTS AND (parts GREATER 0))
|
||||
add_custom_target(test_${testname})
|
||||
if(NOT MSVC_IDE)
|
||||
add_custom_target(debug_${testname})
|
||||
endif(NOT MSVC_IDE)
|
||||
foreach(part RANGE 1 ${parts})
|
||||
message("multipart argv2 ${ARGV2} argv3 ${ARGV3}")
|
||||
ei_add_test_internal(${testname} ${testname}_${part} "${ARGV2} -DEIGEN_TEST_PART_${part}" "${ARGV3}")
|
||||
ei_add_test_internal(${testname} ${testname}_${part} "${ARGV1} -DEIGEN_TEST_PART_${part}" "${ARGV2}")
|
||||
add_dependencies(test_${testname} test_${testname}_${part})
|
||||
if(NOT MSVC_IDE)
|
||||
add_dependencies(debug_${testname} debug_${testname}_${part})
|
||||
endif(NOT MSVC_IDE)
|
||||
endforeach(part)
|
||||
else(EIGEN_SPLIT_LARGE_TESTS)
|
||||
else(EIGEN_SPLIT_LARGE_TESTS AND (parts GREATER 0))
|
||||
set(symbols_to_enable_all_parts "")
|
||||
foreach(part RANGE 1 ${parts})
|
||||
set(symbols_to_enable_all_parts "${symbols_to_enable_all_parts} -DEIGEN_TEST_PART_${part}")
|
||||
endforeach(part)
|
||||
ei_add_test_internal(${testname} ${testname} "${ARGV2} ${symbols_to_enable_all_parts}" "${ARGV3}")
|
||||
endif(EIGEN_SPLIT_LARGE_TESTS)
|
||||
endmacro(ei_add_test_multi)
|
||||
ei_add_test_internal(${testname} ${testname} "${ARGV1} ${symbols_to_enable_all_parts}" "${ARGV2}")
|
||||
endif(EIGEN_SPLIT_LARGE_TESTS AND (parts GREATER 0))
|
||||
endmacro(ei_add_test)
|
||||
|
||||
# print a summary of the different options
|
||||
macro(ei_testing_print_summary)
|
||||
|
@ -121,7 +121,7 @@ ei_add_test(product_notemporary ${EI_OFLAG})
|
||||
ei_add_test(stable_norm)
|
||||
ei_add_test(bandmatrix)
|
||||
ei_add_test(cholesky " " "${GSL_LIBRARIES}")
|
||||
ei_add_test_multi(6 lu ${EI_OFLAG})
|
||||
ei_add_test(lu ${EI_OFLAG})
|
||||
ei_add_test(determinant)
|
||||
ei_add_test(inverse ${EI_OFLAG})
|
||||
ei_add_test(qr)
|
||||
|
@ -54,8 +54,8 @@ template<typename MatrixType> void eigensolver(const MatrixType& m)
|
||||
void test_eigensolver_complex()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
CALL_SUBTEST( eigensolver(Matrix4cf()) );
|
||||
CALL_SUBTEST( eigensolver(MatrixXcd(14,14)) );
|
||||
CALL_SUBTEST1( eigensolver(Matrix4cf()) );
|
||||
CALL_SUBTEST2( eigensolver(MatrixXcd(14,14)) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,18 +75,18 @@ template<typename MatrixType> void eigensolver_verify_assert()
|
||||
void test_eigensolver_generic()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
CALL_SUBTEST( eigensolver(Matrix4f()) );
|
||||
CALL_SUBTEST( eigensolver(MatrixXd(17,17)) );
|
||||
CALL_SUBTEST1( eigensolver(Matrix4f()) );
|
||||
CALL_SUBTEST2( eigensolver(MatrixXd(17,17)) );
|
||||
|
||||
// some trivial but implementation-wise tricky cases
|
||||
CALL_SUBTEST( eigensolver(MatrixXd(1,1)) );
|
||||
CALL_SUBTEST( eigensolver(MatrixXd(2,2)) );
|
||||
CALL_SUBTEST( eigensolver(Matrix<double,1,1>()) );
|
||||
CALL_SUBTEST( eigensolver(Matrix<double,2,2>()) );
|
||||
CALL_SUBTEST2( eigensolver(MatrixXd(1,1)) );
|
||||
CALL_SUBTEST2( eigensolver(MatrixXd(2,2)) );
|
||||
CALL_SUBTEST3( eigensolver(Matrix<double,1,1>()) );
|
||||
CALL_SUBTEST4( eigensolver(Matrix2d()) );
|
||||
}
|
||||
|
||||
CALL_SUBTEST( eigensolver_verify_assert<Matrix3f>() );
|
||||
CALL_SUBTEST( eigensolver_verify_assert<Matrix3d>() );
|
||||
CALL_SUBTEST( eigensolver_verify_assert<MatrixXf>() );
|
||||
CALL_SUBTEST( eigensolver_verify_assert<MatrixXd>() );
|
||||
CALL_SUBTEST1( eigensolver_verify_assert<Matrix4f>() );
|
||||
CALL_SUBTEST2( eigensolver_verify_assert<MatrixXd>() );
|
||||
CALL_SUBTEST4( eigensolver_verify_assert<Matrix2d>() );
|
||||
CALL_SUBTEST5( eigensolver_verify_assert<MatrixXf>() );
|
||||
}
|
||||
|
@ -117,17 +117,17 @@ void test_eigensolver_selfadjoint()
|
||||
{
|
||||
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(10,10)) );
|
||||
CALL_SUBTEST( selfadjointeigensolver(MatrixXd(19,19)) );
|
||||
CALL_SUBTEST( selfadjointeigensolver(MatrixXcd(17,17)) );
|
||||
CALL_SUBTEST1( selfadjointeigensolver(Matrix3f()) );
|
||||
CALL_SUBTEST2( selfadjointeigensolver(Matrix4d()) );
|
||||
CALL_SUBTEST3( selfadjointeigensolver(MatrixXf(10,10)) );
|
||||
CALL_SUBTEST4( selfadjointeigensolver(MatrixXd(19,19)) );
|
||||
CALL_SUBTEST5( selfadjointeigensolver(MatrixXcd(17,17)) );
|
||||
|
||||
// some trivial but implementation-wise tricky cases
|
||||
CALL_SUBTEST( selfadjointeigensolver(MatrixXd(1,1)) );
|
||||
CALL_SUBTEST( selfadjointeigensolver(MatrixXd(2,2)) );
|
||||
CALL_SUBTEST( selfadjointeigensolver(Matrix<double,1,1>()) );
|
||||
CALL_SUBTEST( selfadjointeigensolver(Matrix<double,2,2>()) );
|
||||
CALL_SUBTEST4( selfadjointeigensolver(MatrixXd(1,1)) );
|
||||
CALL_SUBTEST4( selfadjointeigensolver(MatrixXd(2,2)) );
|
||||
CALL_SUBTEST6( selfadjointeigensolver(Matrix<double,1,1>()) );
|
||||
CALL_SUBTEST7( selfadjointeigensolver(Matrix<double,2,2>()) );
|
||||
}
|
||||
}
|
||||
|
||||
|
44
test/lu.cpp
44
test/lu.cpp
@ -153,28 +153,26 @@ template<typename MatrixType> void lu_verify_assert()
|
||||
void test_lu()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
#if defined EIGEN_TEST_PART_1
|
||||
CALL_SUBTEST( lu_non_invertible<Matrix3f>() );
|
||||
CALL_SUBTEST( lu_verify_assert<Matrix3f>() );
|
||||
#elif defined EIGEN_TEST_PART_2
|
||||
CALL_SUBTEST( (lu_non_invertible<Matrix<double, 4, 6> >()) );
|
||||
CALL_SUBTEST( (lu_verify_assert<Matrix<double, 4, 6> >()) );
|
||||
#elif defined EIGEN_TEST_PART_3
|
||||
CALL_SUBTEST( lu_non_invertible<MatrixXf>() );
|
||||
CALL_SUBTEST( lu_invertible<MatrixXf>() );
|
||||
CALL_SUBTEST( lu_verify_assert<MatrixXf>() );
|
||||
#elif defined EIGEN_TEST_PART_4
|
||||
CALL_SUBTEST( lu_non_invertible<MatrixXd>() );
|
||||
CALL_SUBTEST( lu_invertible<MatrixXd>() );
|
||||
CALL_SUBTEST( lu_verify_assert<MatrixXd>() );
|
||||
#elif defined EIGEN_TEST_PART_5
|
||||
CALL_SUBTEST( lu_non_invertible<MatrixXcf>() );
|
||||
CALL_SUBTEST( lu_invertible<MatrixXcf>() );
|
||||
CALL_SUBTEST( lu_verify_assert<MatrixXcf>() );
|
||||
#elif defined EIGEN_TEST_PART_6
|
||||
CALL_SUBTEST( lu_non_invertible<MatrixXcd>() );
|
||||
CALL_SUBTEST( lu_invertible<MatrixXcd>() );
|
||||
CALL_SUBTEST( lu_verify_assert<MatrixXcd>() );
|
||||
#endif
|
||||
CALL_SUBTEST1( lu_non_invertible<Matrix3f>() );
|
||||
CALL_SUBTEST1( lu_verify_assert<Matrix3f>() );
|
||||
|
||||
CALL_SUBTEST2( (lu_non_invertible<Matrix<double, 4, 6> >()) );
|
||||
CALL_SUBTEST2( (lu_verify_assert<Matrix<double, 4, 6> >()) );
|
||||
|
||||
CALL_SUBTEST3( lu_non_invertible<MatrixXf>() );
|
||||
CALL_SUBTEST3( lu_invertible<MatrixXf>() );
|
||||
CALL_SUBTEST3( lu_verify_assert<MatrixXf>() );
|
||||
|
||||
CALL_SUBTEST4( lu_non_invertible<MatrixXd>() );
|
||||
CALL_SUBTEST4( lu_invertible<MatrixXd>() );
|
||||
CALL_SUBTEST4( lu_verify_assert<MatrixXd>() );
|
||||
|
||||
CALL_SUBTEST5( lu_non_invertible<MatrixXcf>() );
|
||||
CALL_SUBTEST5( lu_invertible<MatrixXcf>() );
|
||||
CALL_SUBTEST5( lu_verify_assert<MatrixXcf>() );
|
||||
|
||||
CALL_SUBTEST6( lu_non_invertible<MatrixXcd>() );
|
||||
CALL_SUBTEST6( lu_invertible<MatrixXcd>() );
|
||||
CALL_SUBTEST6( lu_verify_assert<MatrixXcd>() );
|
||||
}
|
||||
}
|
||||
|
60
test/main.h
60
test/main.h
@ -170,6 +170,66 @@ namespace Eigen
|
||||
g_test_stack.pop_back(); \
|
||||
} while (0)
|
||||
|
||||
#ifdef EIGEN_TEST_PART_1
|
||||
#define CALL_SUBTEST1(FUNC) CALL_SUBTEST(FUNC)
|
||||
#else
|
||||
#define CALL_SUBTEST1(FUNC)
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_TEST_PART_2
|
||||
#define CALL_SUBTEST2(FUNC) CALL_SUBTEST(FUNC)
|
||||
#else
|
||||
#define CALL_SUBTEST2(FUNC)
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_TEST_PART_3
|
||||
#define CALL_SUBTEST3(FUNC) CALL_SUBTEST(FUNC)
|
||||
#else
|
||||
#define CALL_SUBTEST3(FUNC)
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_TEST_PART_4
|
||||
#define CALL_SUBTEST4(FUNC) CALL_SUBTEST(FUNC)
|
||||
#else
|
||||
#define CALL_SUBTEST4(FUNC)
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_TEST_PART_5
|
||||
#define CALL_SUBTEST5(FUNC) CALL_SUBTEST(FUNC)
|
||||
#else
|
||||
#define CALL_SUBTEST5(FUNC)
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_TEST_PART_6
|
||||
#define CALL_SUBTEST6(FUNC) CALL_SUBTEST(FUNC)
|
||||
#else
|
||||
#define CALL_SUBTEST6(FUNC)
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_TEST_PART_7
|
||||
#define CALL_SUBTEST7(FUNC) CALL_SUBTEST(FUNC)
|
||||
#else
|
||||
#define CALL_SUBTEST7(FUNC)
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_TEST_PART_8
|
||||
#define CALL_SUBTEST8(FUNC) CALL_SUBTEST(FUNC)
|
||||
#else
|
||||
#define CALL_SUBTEST8(FUNC)
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_TEST_PART_9
|
||||
#define CALL_SUBTEST9(FUNC) CALL_SUBTEST(FUNC)
|
||||
#else
|
||||
#define CALL_SUBTEST9(FUNC)
|
||||
#endif
|
||||
|
||||
#ifdef EIGEN_TEST_PART_10
|
||||
#define CALL_SUBTEST10(FUNC) CALL_SUBTEST(FUNC)
|
||||
#else
|
||||
#define CALL_SUBTEST10(FUNC)
|
||||
#endif
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
template<typename T> inline typename NumTraits<T>::Real test_precision();
|
||||
|
@ -119,8 +119,8 @@ template<typename MatrixType> void product_extra(const MatrixType& m)
|
||||
void test_product_extra()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
CALL_SUBTEST( product_extra(MatrixXf(ei_random<int>(2,320), ei_random<int>(2,320))) );
|
||||
CALL_SUBTEST( product_extra(MatrixXcf(ei_random<int>(50,50), ei_random<int>(50,50))) );
|
||||
CALL_SUBTEST( product_extra(Matrix<std::complex<double>,Dynamic,Dynamic,RowMajor>(ei_random<int>(2,50), ei_random<int>(2,50))) );
|
||||
CALL_SUBTEST1( product_extra(MatrixXf(ei_random<int>(2,320), ei_random<int>(2,320))) );
|
||||
CALL_SUBTEST2( product_extra(MatrixXcf(ei_random<int>(50,50), ei_random<int>(50,50))) );
|
||||
CALL_SUBTEST3( product_extra(Matrix<std::complex<double>,Dynamic,Dynamic,RowMajor>(ei_random<int>(2,50), ei_random<int>(2,50))) );
|
||||
}
|
||||
}
|
||||
|
@ -27,13 +27,14 @@
|
||||
void test_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_SUBTEST1( product(MatrixXf(ei_random<int>(1,320), ei_random<int>(1,320))) );
|
||||
CALL_SUBTEST2( product(MatrixXd(ei_random<int>(1,320), ei_random<int>(1,320))) );
|
||||
CALL_SUBTEST3( product(MatrixXi(ei_random<int>(1,320), ei_random<int>(1,320))) );
|
||||
CALL_SUBTEST4( product(MatrixXcf(ei_random<int>(1,50), ei_random<int>(1,50))) );
|
||||
CALL_SUBTEST5( product(Matrix<float,Dynamic,Dynamic,RowMajor>(ei_random<int>(1,320), ei_random<int>(1,320))) );
|
||||
}
|
||||
|
||||
#if defined EIGEN_TEST_PART_6
|
||||
{
|
||||
// test a specific issue in DiagonalProduct
|
||||
int N = 1000000;
|
||||
@ -48,4 +49,5 @@ void test_product_large()
|
||||
MatrixXf a = MatrixXf::Random(10,4), b = MatrixXf::Random(4,10), c = a;
|
||||
VERIFY_IS_APPROX((a = a * b), (c * b).eval());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -117,8 +117,8 @@ void test_product_notemporary()
|
||||
int s;
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
s = ei_random<int>(16,320);
|
||||
CALL_SUBTEST( product_notemporary(MatrixXf(s, s)) );
|
||||
CALL_SUBTEST1( product_notemporary(MatrixXf(s, s)) );
|
||||
s = ei_random<int>(16,120);
|
||||
CALL_SUBTEST( product_notemporary(MatrixXcd(s,s)) );
|
||||
CALL_SUBTEST2( product_notemporary(MatrixXcd(s,s)) );
|
||||
}
|
||||
}
|
||||
|
@ -78,13 +78,13 @@ template<typename MatrixType> void product_selfadjoint(const MatrixType& m)
|
||||
void test_product_selfadjoint()
|
||||
{
|
||||
for(int i = 0; i < g_repeat ; i++) {
|
||||
CALL_SUBTEST( product_selfadjoint(Matrix<float, 1, 1>()) );
|
||||
CALL_SUBTEST( product_selfadjoint(Matrix<float, 2, 2>()) );
|
||||
CALL_SUBTEST( product_selfadjoint(Matrix3d()) );
|
||||
CALL_SUBTEST( product_selfadjoint(MatrixXcf(4, 4)) );
|
||||
CALL_SUBTEST( product_selfadjoint(MatrixXcd(21,21)) );
|
||||
CALL_SUBTEST( product_selfadjoint(MatrixXd(14,14)) );
|
||||
CALL_SUBTEST( product_selfadjoint(Matrix<float,Dynamic,Dynamic,RowMajor>(17,17)) );
|
||||
CALL_SUBTEST( product_selfadjoint(Matrix<std::complex<double>,Dynamic,Dynamic,RowMajor>(19, 19)) );
|
||||
CALL_SUBTEST1( product_selfadjoint(Matrix<float, 1, 1>()) );
|
||||
CALL_SUBTEST2( product_selfadjoint(Matrix<float, 2, 2>()) );
|
||||
CALL_SUBTEST3( product_selfadjoint(Matrix3d()) );
|
||||
CALL_SUBTEST4( product_selfadjoint(MatrixXcf(4, 4)) );
|
||||
CALL_SUBTEST5( product_selfadjoint(MatrixXcd(21,21)) );
|
||||
CALL_SUBTEST6( product_selfadjoint(MatrixXd(14,14)) );
|
||||
CALL_SUBTEST7( product_selfadjoint(Matrix<float,Dynamic,Dynamic,RowMajor>(17,17)) );
|
||||
CALL_SUBTEST8( product_selfadjoint(Matrix<std::complex<double>,Dynamic,Dynamic,RowMajor>(19, 19)) );
|
||||
}
|
||||
}
|
||||
|
@ -28,16 +28,18 @@
|
||||
void test_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_SUBTEST1( product(Matrix<float, 3, 2>()) );
|
||||
CALL_SUBTEST2( product(Matrix<int, 3, 5>()) );
|
||||
CALL_SUBTEST3( product(Matrix3d()) );
|
||||
CALL_SUBTEST4( product(Matrix4d()) );
|
||||
CALL_SUBTEST5( product(Matrix4f()) );
|
||||
}
|
||||
|
||||
#ifdef EIGEN_TEST_PART_6
|
||||
{
|
||||
// test compilation of (outer_product) * vector
|
||||
Vector3f v = Vector3f::Random();
|
||||
VERIFY_IS_APPROX( (v * v.transpose()) * v, (v * v.transpose()).eval() * v);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -108,10 +108,10 @@ void test_product_symm()
|
||||
{
|
||||
for(int i = 0; i < g_repeat ; i++)
|
||||
{
|
||||
CALL_SUBTEST(( symm<float,Dynamic,Dynamic>(ei_random<int>(10,320),ei_random<int>(10,320)) ));
|
||||
CALL_SUBTEST(( symm<std::complex<double>,Dynamic,Dynamic>(ei_random<int>(10,320),ei_random<int>(10,320)) ));
|
||||
CALL_SUBTEST1(( symm<float,Dynamic,Dynamic>(ei_random<int>(10,320),ei_random<int>(10,320)) ));
|
||||
CALL_SUBTEST2(( symm<std::complex<double>,Dynamic,Dynamic>(ei_random<int>(10,320),ei_random<int>(10,320)) ));
|
||||
|
||||
CALL_SUBTEST(( symm<float,Dynamic,1>(ei_random<int>(10,320)) ));
|
||||
CALL_SUBTEST(( symm<std::complex<double>,Dynamic,1>(ei_random<int>(10,320)) ));
|
||||
CALL_SUBTEST3(( symm<float,Dynamic,1>(ei_random<int>(10,320)) ));
|
||||
CALL_SUBTEST4(( symm<std::complex<double>,Dynamic,1>(ei_random<int>(10,320)) ));
|
||||
}
|
||||
}
|
||||
|
@ -75,8 +75,8 @@ void test_product_syrk()
|
||||
{
|
||||
int s;
|
||||
s = ei_random<int>(10,320);
|
||||
CALL_SUBTEST( syrk(MatrixXf(s, s)) );
|
||||
CALL_SUBTEST1( syrk(MatrixXf(s, s)) );
|
||||
s = ei_random<int>(10,320);
|
||||
CALL_SUBTEST( syrk(MatrixXcd(s, s)) );
|
||||
CALL_SUBTEST2( syrk(MatrixXcd(s, s)) );
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ void test_product_trmm()
|
||||
{
|
||||
for(int i = 0; i < g_repeat ; i++)
|
||||
{
|
||||
trmm<float>(ei_random<int>(1,320),ei_random<int>(1,320));
|
||||
trmm<std::complex<double> >(ei_random<int>(1,320),ei_random<int>(1,320));
|
||||
CALL_SUBTEST1((trmm<float>(ei_random<int>(1,320),ei_random<int>(1,320))));
|
||||
CALL_SUBTEST2((trmm<std::complex<double> >(ei_random<int>(1,320),ei_random<int>(1,320))));
|
||||
}
|
||||
}
|
||||
|
@ -82,11 +82,11 @@ template<typename MatrixType> void trmv(const MatrixType& m)
|
||||
void test_product_trmv()
|
||||
{
|
||||
for(int i = 0; i < g_repeat ; i++) {
|
||||
CALL_SUBTEST( trmv(Matrix<float, 1, 1>()) );
|
||||
CALL_SUBTEST( trmv(Matrix<float, 2, 2>()) );
|
||||
CALL_SUBTEST( trmv(Matrix3d()) );
|
||||
CALL_SUBTEST( trmv(Matrix<std::complex<float>,23, 23>()) );
|
||||
CALL_SUBTEST( trmv(MatrixXcd(17,17)) );
|
||||
CALL_SUBTEST( trmv(Matrix<float,Dynamic,Dynamic,RowMajor>(19, 19)) );
|
||||
CALL_SUBTEST1( trmv(Matrix<float, 1, 1>()) );
|
||||
CALL_SUBTEST2( trmv(Matrix<float, 2, 2>()) );
|
||||
CALL_SUBTEST3( trmv(Matrix3d()) );
|
||||
CALL_SUBTEST4( trmv(Matrix<std::complex<float>,23, 23>()) );
|
||||
CALL_SUBTEST5( trmv(MatrixXcd(17,17)) );
|
||||
CALL_SUBTEST6( trmv(Matrix<float,Dynamic,Dynamic,RowMajor>(19, 19)) );
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ void test_product_trsm()
|
||||
{
|
||||
for(int i = 0; i < g_repeat ; i++)
|
||||
{
|
||||
trsm<float>(ei_random<int>(1,320),ei_random<int>(1,320));
|
||||
trsm<std::complex<double> >(ei_random<int>(1,320),ei_random<int>(1,320));
|
||||
CALL_SUBTEST1((trsm<float>(ei_random<int>(1,320),ei_random<int>(1,320))));
|
||||
CALL_SUBTEST2((trsm<std::complex<double> >(ei_random<int>(1,320),ei_random<int>(1,320))));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user