mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Split and reduce SVD test sizes.
This commit is contained in:
@@ -112,19 +112,19 @@ void msvc_workaround()
|
||||
|
||||
EIGEN_DECLARE_TEST(jacobisvd)
|
||||
{
|
||||
CALL_SUBTEST_4((jacobisvd_verify_inputs<Matrix4d>()));
|
||||
CALL_SUBTEST_7((jacobisvd_verify_inputs(Matrix<float, 10, Dynamic>(10, 12))));
|
||||
CALL_SUBTEST_8((jacobisvd_verify_inputs<Matrix<std::complex<double>, 7, 5>>()));
|
||||
CALL_SUBTEST_1((jacobisvd_verify_inputs<Matrix4d>()));
|
||||
CALL_SUBTEST_1((jacobisvd_verify_inputs(Matrix<float, 5, Dynamic>(5, 6))));
|
||||
CALL_SUBTEST_1((jacobisvd_verify_inputs<Matrix<std::complex<double>, 7, 5>>()));
|
||||
|
||||
CALL_SUBTEST_3((jacobisvd_verify_assert<Matrix3f>()));
|
||||
CALL_SUBTEST_4((jacobisvd_verify_assert<Matrix4d>()));
|
||||
CALL_SUBTEST_7((jacobisvd_verify_assert<Matrix<float, 10, 12>>()));
|
||||
CALL_SUBTEST_7((jacobisvd_verify_assert<Matrix<float, 12, 10>>()));
|
||||
CALL_SUBTEST_7((jacobisvd_verify_assert<MatrixXf>(MatrixXf(10, 12))));
|
||||
CALL_SUBTEST_8((jacobisvd_verify_assert<MatrixXcd>(MatrixXcd(7, 5))));
|
||||
CALL_SUBTEST_2((jacobisvd_verify_assert<Matrix3f>()));
|
||||
CALL_SUBTEST_2((jacobisvd_verify_assert<Matrix4d>()));
|
||||
CALL_SUBTEST_2((jacobisvd_verify_assert<Matrix<float, 10, 12>>()));
|
||||
CALL_SUBTEST_2((jacobisvd_verify_assert<Matrix<float, 12, 10>>()));
|
||||
CALL_SUBTEST_2((jacobisvd_verify_assert<MatrixXf>(MatrixXf(10, 12))));
|
||||
CALL_SUBTEST_2((jacobisvd_verify_assert<MatrixXcd>(MatrixXcd(7, 5))));
|
||||
|
||||
CALL_SUBTEST_11(svd_all_trivial_2x2(jacobisvd_all_options<Matrix2cd>));
|
||||
CALL_SUBTEST_12(svd_all_trivial_2x2(jacobisvd_all_options<Matrix2d>));
|
||||
CALL_SUBTEST_3(svd_all_trivial_2x2(jacobisvd_all_options<Matrix2cd>));
|
||||
CALL_SUBTEST_4(svd_all_trivial_2x2(jacobisvd_all_options<Matrix2d>));
|
||||
|
||||
for (int i = 0; i < g_repeat; i++) {
|
||||
int r = internal::random<int>(1, 30),
|
||||
@@ -132,65 +132,65 @@ EIGEN_DECLARE_TEST(jacobisvd)
|
||||
|
||||
TEST_SET_BUT_UNUSED_VARIABLE(r)
|
||||
TEST_SET_BUT_UNUSED_VARIABLE(c)
|
||||
|
||||
CALL_SUBTEST_3((jacobisvd_all_options<Matrix3f>()));
|
||||
CALL_SUBTEST_3((jacobisvd_all_options<Matrix<float, 2, 3>>()));
|
||||
CALL_SUBTEST_4((jacobisvd_all_options<Matrix4d>()));
|
||||
CALL_SUBTEST_4((jacobisvd_all_options<Matrix<double, 10, 16>>()));
|
||||
CALL_SUBTEST_4((jacobisvd_all_options<Matrix<double, 16, 10>>()));
|
||||
CALL_SUBTEST_5((jacobisvd_all_options<Matrix<double, Dynamic, 16>>(Matrix<double, Dynamic, 16>(r, 16))));
|
||||
CALL_SUBTEST_5((jacobisvd_all_options<Matrix<double, 10, Dynamic>>(Matrix<double, 10, Dynamic>(10, c))));
|
||||
CALL_SUBTEST_7((jacobisvd_all_options<MatrixXf>(MatrixXf(r, c))));
|
||||
CALL_SUBTEST_8((jacobisvd_all_options<MatrixXcd>(MatrixXcd(r, c))));
|
||||
CALL_SUBTEST_10((jacobisvd_all_options<MatrixXd>(MatrixXd(r, c))));
|
||||
CALL_SUBTEST_14((jacobisvd_all_options<Matrix<double, 5, 7, RowMajor>>()));
|
||||
CALL_SUBTEST_14((jacobisvd_all_options<Matrix<double, 7, 5, RowMajor>>()));
|
||||
|
||||
CALL_SUBTEST_5((jacobisvd_all_options<Matrix3f>()));
|
||||
CALL_SUBTEST_6((jacobisvd_all_options<Matrix4d>()));
|
||||
CALL_SUBTEST_7((jacobisvd_all_options<Matrix<float, 2, 3>>()));
|
||||
CALL_SUBTEST_8((jacobisvd_all_options<Matrix<double, 4, 7>>()));
|
||||
CALL_SUBTEST_9((jacobisvd_all_options<Matrix<double, 7, 4>>()));
|
||||
CALL_SUBTEST_10((jacobisvd_all_options<Matrix<double, Dynamic, 5>>(Matrix<double, Dynamic, 5>(r, 5))));
|
||||
CALL_SUBTEST_11((jacobisvd_all_options<Matrix<double, 5, Dynamic>>(Matrix<double, 5, Dynamic>(5, c))));
|
||||
CALL_SUBTEST_12((jacobisvd_all_options<MatrixXf>(MatrixXf(r, c))));
|
||||
CALL_SUBTEST_13((jacobisvd_all_options<MatrixXcd>(MatrixXcd(r, c))));
|
||||
CALL_SUBTEST_14((jacobisvd_all_options<MatrixXd>(MatrixXd(r, c))));
|
||||
CALL_SUBTEST_15((jacobisvd_all_options<Matrix<double, 5, 7, RowMajor>>()));
|
||||
CALL_SUBTEST_16((jacobisvd_all_options<Matrix<double, 7, 5, RowMajor>>()));
|
||||
|
||||
MatrixXcd noQRTest = MatrixXcd(r, r);
|
||||
svd_fill_random(noQRTest);
|
||||
CALL_SUBTEST_16((svd_option_checks<MatrixXcd, NoQRPreconditioner>(noQRTest)));
|
||||
CALL_SUBTEST_17((svd_option_checks<MatrixXcd, NoQRPreconditioner>(noQRTest)));
|
||||
|
||||
CALL_SUBTEST_15((
|
||||
CALL_SUBTEST_18((
|
||||
svd_check_max_size_matrix<Matrix<float, Dynamic, Dynamic, ColMajor, 13, 15>, ColPivHouseholderQRPreconditioner>(
|
||||
r, c)));
|
||||
CALL_SUBTEST_15(
|
||||
CALL_SUBTEST_18(
|
||||
(svd_check_max_size_matrix<Matrix<float, Dynamic, Dynamic, ColMajor, 15, 13>, HouseholderQRPreconditioner>(r,
|
||||
c)));
|
||||
CALL_SUBTEST_15((
|
||||
CALL_SUBTEST_18((
|
||||
svd_check_max_size_matrix<Matrix<float, Dynamic, Dynamic, RowMajor, 13, 15>, ColPivHouseholderQRPreconditioner>(
|
||||
r, c)));
|
||||
CALL_SUBTEST_15(
|
||||
CALL_SUBTEST_18(
|
||||
(svd_check_max_size_matrix<Matrix<float, Dynamic, Dynamic, RowMajor, 15, 13>, HouseholderQRPreconditioner>(r,
|
||||
c)));
|
||||
|
||||
// Test on inf/nan matrix
|
||||
CALL_SUBTEST_7((svd_inf_nan<MatrixXf>()));
|
||||
CALL_SUBTEST_10((svd_inf_nan<MatrixXd>()));
|
||||
CALL_SUBTEST_19((svd_inf_nan<MatrixXf>()));
|
||||
CALL_SUBTEST_19((svd_inf_nan<MatrixXd>()));
|
||||
|
||||
CALL_SUBTEST_13((jacobisvd_verify_assert<Matrix<double, 6, 1>>()));
|
||||
CALL_SUBTEST_13((jacobisvd_verify_assert<Matrix<double, 1, 6>>()));
|
||||
CALL_SUBTEST_13((jacobisvd_verify_assert<Matrix<double, Dynamic, 1>>(Matrix<double, Dynamic, 1>(r))));
|
||||
CALL_SUBTEST_13((jacobisvd_verify_assert<Matrix<double, 1, Dynamic>>(Matrix<double, 1, Dynamic>(c))));
|
||||
CALL_SUBTEST_20((jacobisvd_verify_assert<Matrix<double, 6, 1>>()));
|
||||
CALL_SUBTEST_20((jacobisvd_verify_assert<Matrix<double, 1, 6>>()));
|
||||
CALL_SUBTEST_20((jacobisvd_verify_assert<Matrix<double, Dynamic, 1>>(Matrix<double, Dynamic, 1>(r))));
|
||||
CALL_SUBTEST_20((jacobisvd_verify_assert<Matrix<double, 1, Dynamic>>(Matrix<double, 1, Dynamic>(c))));
|
||||
}
|
||||
|
||||
CALL_SUBTEST_7((jacobisvd_all_options<MatrixXd>(
|
||||
CALL_SUBTEST_21((jacobisvd_all_options<MatrixXd>(
|
||||
MatrixXd(internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE / 2),
|
||||
internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE / 2)))));
|
||||
CALL_SUBTEST_8((jacobisvd_all_options<MatrixXcd>(
|
||||
CALL_SUBTEST_22((jacobisvd_all_options<MatrixXcd>(
|
||||
MatrixXcd(internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE / 3),
|
||||
internal::random<int>(EIGEN_TEST_MAX_SIZE / 4, EIGEN_TEST_MAX_SIZE / 3)))));
|
||||
|
||||
// test matrixbase method
|
||||
CALL_SUBTEST_1(( jacobisvd_method<Matrix2cd>() ));
|
||||
CALL_SUBTEST_3(( jacobisvd_method<Matrix3f>() ));
|
||||
CALL_SUBTEST_23(( jacobisvd_method<Matrix2cd>() ));
|
||||
CALL_SUBTEST_23(( jacobisvd_method<Matrix3f>() ));
|
||||
|
||||
// Test problem size constructors
|
||||
CALL_SUBTEST_7( JacobiSVD<MatrixXf>(10,10) );
|
||||
CALL_SUBTEST_24( JacobiSVD<MatrixXf>(10,10) );
|
||||
|
||||
// Check that preallocation avoids subsequent mallocs
|
||||
CALL_SUBTEST_9( svd_preallocate<void>() );
|
||||
CALL_SUBTEST_25( svd_preallocate<void>() );
|
||||
|
||||
CALL_SUBTEST_2( svd_underoverflow<void>() );
|
||||
CALL_SUBTEST_26( svd_underoverflow<void>() );
|
||||
|
||||
msvc_workaround();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user