]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid floating point exception in Lapack test 4060/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sun, 12 Mar 2017 19:16:24 +0000 (20:16 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sun, 12 Mar 2017 19:16:24 +0000 (20:16 +0100)
tests/lapack/full_matrix_14.cc

index 77e3f1cec92dc1c2f01ee2c3d20ca59ddafb88e1..e1f89e3ccb2f18854e6483bc4345cd73992369c0 100644 (file)
@@ -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<double> v(n);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.