From 09708ff7dd832a5b4d8e158a07a683e4ad86a884 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Sun, 12 Mar 2017 20:16:24 +0100 Subject: [PATCH] Avoid floating point exception in Lapack test --- tests/lapack/full_matrix_14.cc | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.39.5