]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a bug that shows up when a line is empty.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 19 May 2000 15:07:52 +0000 (15:07 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 19 May 2000 15:07:52 +0000 (15:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@2900 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/sparsity_pattern.cc

index 8876b4dfa94a3fa988aebe009fbed215f5b35313..22e14002c23fe5b14c47852a172c09a3ec83dde7 100644 (file)
@@ -389,14 +389,22 @@ SparsityPattern::compress ()
                                       // among themselves (this handles
                                       // both cases, quadratic and
                                       // rectangular matrices)
-      Assert (find (&new_colnums[rowstart[line]+1],
-                   &new_colnums[next_row_start],
-                   new_colnums[rowstart[line]]) ==
-             &new_colnums[next_row_start],
+                                      //
+                                      // the only exception here is
+                                      // if the row contains no
+                                      // entries at all
+      Assert ((rowstart[line] == rowstart[line+1])
+             ||
+             (find (&new_colnums[rowstart[line]+1],
+                    &new_colnums[next_row_start],
+                    new_colnums[rowstart[line]]) ==
+              &new_colnums[next_row_start]),
              ExcInternalError());
-      Assert (adjacent_find(&new_colnums[rowstart[line]+1],
-                           &new_colnums[next_row_start]) ==
-             &new_colnums[next_row_start],
+      Assert ((rowstart[line] == rowstart[line+1])
+             ||
+             (adjacent_find(&new_colnums[rowstart[line]+1],
+                            &new_colnums[next_row_start]) ==
+              &new_colnums[next_row_start]),
              ExcInternalError());
     };
 

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.