]> https://gitweb.dealii.org/ - dealii.git/commitdiff
The ILU decomposition was not formed properly when the last row only contained a...
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 11 Jun 2009 11:37:55 +0000 (11:37 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 11 Jun 2009 11:37:55 +0000 (11:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@18922 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparse_ilu.templates.h

index 6a1c62ee68521234425afc920090e9ec22b9d92d..f9fb3797ff4eab2b6a0d4102840d2189d207a0de 100644 (file)
@@ -79,6 +79,7 @@ void SparseILU<number>::decompose (const SparseMatrix<somenumber> &matrix,
   number * luval = this->SparseMatrix<number>::val;
 
   const unsigned int N = this->m();
+  unsigned int jrow;
   
   std::vector<unsigned int> iw (N, numbers::invalid_unsigned_int);
   
@@ -102,9 +103,16 @@ void SparseILU<number>::decompose (const SparseMatrix<somenumber> &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;
 

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.