From dada863d2388079a91c413a109a0317a5814d2e7 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 11 Feb 2019 17:56:20 +0100 Subject: Enable unit tests of PartialPivLU on fixed size matrices, and increase tested matrix size (blocking was not tested!) --- test/lu.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test/lu.cpp') diff --git a/test/lu.cpp b/test/lu.cpp index bb6ae124b..1bbadcbf0 100644 --- a/test/lu.cpp +++ b/test/lu.cpp @@ -110,7 +110,7 @@ template void lu_non_invertible() template void lu_invertible() { /* this test covers the following files: - LU.h + FullPivLU.h */ typedef typename NumTraits::Real RealScalar; Index size = MatrixType::RowsAtCompileTime; @@ -152,13 +152,12 @@ template void lu_invertible() VERIFY_IS_APPROX(lu.solve(m3*m4), lu.solve(m3)*m4); } -template void lu_partial_piv() +template void lu_partial_piv(Index size = MatrixType::ColsAtCompileTime) { /* this test covers the following files: PartialPivLU.h */ typedef typename NumTraits::Real RealScalar; - Index size = internal::random(1,4); MatrixType m1(size, size), m2(size, size), m3(size, size); m1.setRandom(); @@ -218,9 +217,13 @@ EIGEN_DECLARE_TEST(lu) CALL_SUBTEST_1( lu_non_invertible() ); CALL_SUBTEST_1( lu_invertible() ); CALL_SUBTEST_1( lu_verify_assert() ); + CALL_SUBTEST_1( lu_partial_piv() ); CALL_SUBTEST_2( (lu_non_invertible >()) ); CALL_SUBTEST_2( (lu_verify_assert >()) ); + CALL_SUBTEST_2( lu_partial_piv() ); + CALL_SUBTEST_2( lu_partial_piv() ); + CALL_SUBTEST_2( (lu_partial_piv >()) ); CALL_SUBTEST_3( lu_non_invertible() ); CALL_SUBTEST_3( lu_invertible() ); @@ -228,7 +231,7 @@ EIGEN_DECLARE_TEST(lu) CALL_SUBTEST_4( lu_non_invertible() ); CALL_SUBTEST_4( lu_invertible() ); - CALL_SUBTEST_4( lu_partial_piv() ); + CALL_SUBTEST_4( lu_partial_piv(internal::random(1,EIGEN_TEST_MAX_SIZE)) ); CALL_SUBTEST_4( lu_verify_assert() ); CALL_SUBTEST_5( lu_non_invertible() ); @@ -237,7 +240,7 @@ EIGEN_DECLARE_TEST(lu) CALL_SUBTEST_6( lu_non_invertible() ); CALL_SUBTEST_6( lu_invertible() ); - CALL_SUBTEST_6( lu_partial_piv() ); + CALL_SUBTEST_6( lu_partial_piv(internal::random(1,EIGEN_TEST_MAX_SIZE)) ); CALL_SUBTEST_6( lu_verify_assert() ); CALL_SUBTEST_7(( lu_non_invertible >() )); -- cgit v1.2.3