From e55369179d1a7b3ce9509c1c98f0a9e021c4b45a Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Thu, 11 Jun 2009 11:37:55 +0000 Subject: [PATCH] The ILU decomposition was not formed properly when the last row only contained a diagonal element. This should now be fixed. git-svn-id: https://svn.dealii.org/trunk@18922 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/sparse_ilu.templates.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deal.II/lac/include/lac/sparse_ilu.templates.h b/deal.II/lac/include/lac/sparse_ilu.templates.h index 6a1c62ee68..f9fb3797ff 100644 --- a/deal.II/lac/include/lac/sparse_ilu.templates.h +++ b/deal.II/lac/include/lac/sparse_ilu.templates.h @@ -79,6 +79,7 @@ void SparseILU::decompose (const SparseMatrix &matrix, number * luval = this->SparseMatrix::val; const unsigned int N = this->m(); + unsigned int jrow; std::vector iw (N, numbers::invalid_unsigned_int); @@ -102,9 +103,16 @@ void SparseILU::decompose (const SparseMatrix &matrix, // half unsigned int j = j1+1; + // pathological case: the current row + // of the matrix has only the + // diagonal entry. then we have + // nothing to do. + if (j > j2) + goto label_200; + label_150: - unsigned int jrow = ja[j]; + jrow = ja[j]; if (jrow >= k) goto label_200; -- 2.39.5