]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check access in SparsityPatter::compress() 4095/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 22 Mar 2017 18:11:52 +0000 (19:11 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 22 Mar 2017 18:11:52 +0000 (19:11 +0100)
source/lac/sparsity_pattern.cc

index fdd32cfbc2b3388a1fab817f1e516a35758896cc..e2499777366eea392bb1c618da2c1776cabbbe06 100644 (file)
@@ -437,8 +437,11 @@ SparsityPattern::compress ()
       // some internal checks: either the matrix is not quadratic, or if it
       // is, then the first element of this row must be the diagonal element
       // (i.e. with column index==line number)
+      // this test only makes sense if we have written to the index
+      // rowstart_line in new_colnums which is the case if row_length is not 0,
+      // so check this first
       Assert ((!store_diagonal_first_in_row) ||
-              (new_colnums[rowstart[line]] == line),
+              (row_length != 0 && new_colnums[rowstart[line]] == line),
               ExcInternalError());
       // assert that the first entry does not show up in the remaining ones
       // and that the remaining ones are unique among themselves (this handles

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.