From: Martin Kronbichler Date: Sun, 12 Mar 2017 19:16:24 +0000 (+0100) Subject: Avoid floating point exception in Lapack test X-Git-Tag: v8.5.0-rc1~44^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4060%2Fhead;p=dealii.git Avoid floating point exception in Lapack test --- diff --git a/tests/lapack/full_matrix_14.cc b/tests/lapack/full_matrix_14.cc index 77e3f1cec9..e1f89e3ccb 100644 --- a/tests/lapack/full_matrix_14.cc +++ b/tests/lapack/full_matrix_14.cc @@ -44,6 +44,11 @@ void test(const bool is_singular) catch (std::exception &exc) { deallog << "matrix is singular" << std::endl; + // Some implementations of LAPACK do not detect that the vector we pass + // down to the compute_factorization call is compatible with a singular + // matrix and divide by zero that triggers a floating point exception, + // so we add a small number to the diagonal of the matrix. + A(n-1,n-1) += 1e-50; } Vector v(n);