From: Tobias Geerinckx-Rice Date: Mon, 16 Mar 2020 22:51:37 +0000 Subject: gnu: eigen: Stabilise sparseqr test. Taken verbatim from this[0] upstream commit. [0]: https://gitlab.com/libeigen/eigen/-/commit/3b5deeb546d4017b24846f5b0dc3296a50a039fe From 3b5deeb546d4017b24846f5b0dc3296a50a039fe Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 19 Feb 2019 22:57:51 +0100 Subject: [PATCH] bug #899: make sparseqr unit test more stable by 1) trying with larger threshold and 2) relax rank computation for rank-deficient problems. --- test/sparseqr.cpp | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/test/sparseqr.cpp b/test/sparseqr.cpp index 3ffe62314..3576cc626 100644 --- a/test/sparseqr.cpp +++ b/test/sparseqr.cpp @@ -43,6 +43,7 @@ int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows template void test_sparseqr_scalar() { + typedef typename NumTraits::Real RealScalar; typedef SparseMatrix MatrixType; typedef Matrix DenseMat; typedef Matrix DenseVector; @@ -91,14 +92,34 @@ template void test_sparseqr_scalar() exit(0); return; } - - VERIFY_IS_APPROX(A * x, b); - - //Compare with a dense QR solver + + // Compare with a dense QR solver ColPivHouseholderQR dqr(dA); refX = dqr.solve(b); - VERIFY_IS_EQUAL(dqr.rank(), solver.rank()); + bool rank_deficient = A.cols()>A.rows() || dqr.rank() we might have to increase the threshold + // to get a correct solution. + RealScalar th = RealScalar(20)*dA.colwise().norm().maxCoeff()*(A.rows()+A.cols()) * NumTraits::epsilon(); + for(Index k=0; (k<16) && !test_isApprox(A*x,b); ++k) + { + th *= RealScalar(10); + solver.setPivotThreshold(th); + solver.compute(A); + x = solver.solve(b); + } + } + + VERIFY_IS_APPROX(A * x, b); + + // For rank deficient problem, the estimated rank might + // be slightly off, so let's only raise a warning in such cases. + if(rank_deficient) ++g_test_level; + VERIFY_IS_EQUAL(solver.rank(), dqr.rank()); + if(rank_deficient) --g_test_level; + if(solver.rank()==A.cols()) // full rank VERIFY_IS_APPROX(x, refX); // else -- 2.24.1 ssage (Expand)Author 2020-09-28tests: Simplify shell exit status negation;...* tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment.sh, tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-lint.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh: Use the shell '!' keyword to negate command exit status in place of 'if ...; then false; else true; fi' Eric Bavier 2020-05-23guix package: Support multiple profiles with '--list-installed'....* guix/scripts/package.scm (process-query): List installed multiple profiles. * tests/guix-package-net.sh: Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> zimoun 2019-06-14tests: Make builds less expensive....The switch to the reduced bootstrap broke build time assumptions made by tests, notably the assumption that GNU-MAKE-BOOT0 was cheap to build. This commit adjusts this to make these tests cheaper. * gnu/packages/bootstrap.scm (%bootstrap-inputs-for-tests): New variable. * guix/tests.scm (gnu-make-for-tests): New variable. * tests/guix-environment.sh: Use GNU-MAKE-FOR-TESTS instead of GNU-MAKE-BOOT0. Remove test with FINDUTILS-BOOT0. * tests/guix-package-net.sh (boot_make): Use GNU-MAKE-FOR-TESTS. * tests/packages.scm ("GNU Make, bootstrap"): Likewise. * tests/profiles.scm ("profile-derivation relative symlinks, two entries"): Likewise. * tests/union.scm (%bootstrap-inputs): Remove. ("union-build"): Use %BOOTSTRAP-INPUTS-FOR-TESTS instead of %BOOTSTRAP-INPUTS. Ludovic Courtès 2019-01-15guix package: '--upgrade' preserves package order....Fixes <https://bugs.gnu.org/31142>. Reported by Chris Marusich <cmmarusich@gmail.com>. * guix/scripts/package.scm (options->installable)[upgraded]: Use 'fold' instead of 'fold-right'. This reverts eca16a3d1d9e6b2c064e0105c1015258bf2755f2. * tests/guix-package-net.sh: Add 'guix package u' test. Ludovic Courtès 2017-06-02tests: Remove 't-profile-alt-*-link' files....Reported by myglc2 <myglc2@gmail.com> at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27137#11>. * tests/guix-package-net.sh: In the trap, remove $profile_alt-[0-9]*. Ludovic Courtès 2017-01-23guix package: Honor the order of profiles when -p appears multiple times....* guix/scripts/package.scm (process-query): Reverse the order of PROFILES. * tests/guix-package-net.sh: Test it with '--search-paths'. Ludovic Courtès 2015-11-11guix package: '--search-paths' can report combined search paths....Partly fixes <http://bugs.gnu.org/20255>. * guix/scripts/package.scm (search-path-environment-variables): Change 'profile' to 'profiles'; expect it to be a list. (display-search-paths): Likewise. (%default-options): Remove 'profile' entry. (%options) <--profile>: Keep previous values associated with 'profile' in RESULT. (guix-package)[process-actions, process-query]: Handle the possible lack of 'profile' pair in OPTS. Ludovic Courtès