]> https://gitweb.dealii.org/ - dealii.git/commitdiff
SparsityPattern: add an assertion in input data.
authorDavid Wells <drwells@email.unc.edu>
Wed, 16 Nov 2022 18:30:31 +0000 (13:30 -0500)
committerDavid Wells <drwells@email.unc.edu>
Wed, 16 Nov 2022 18:30:31 +0000 (13:30 -0500)
source/lac/sparsity_pattern.cc

index 10f0add3e55e8f2a756df7df663c445a844542ab..8094e9098a51fd1ff64f329729359218f6a57daa 100644 (file)
@@ -783,6 +783,7 @@ SparsityPattern::add_entries(const size_type row,
                              ForwardIterator end,
                              const bool      indices_are_sorted)
 {
+  AssertIndexRange(row, n_rows());
   if (indices_are_sorted == true)
     {
       if (begin != end)
@@ -802,6 +803,7 @@ SparsityPattern::add_entries(const size_type row,
           if (has_larger_entries == false)
             for (; it != end; ++it)
               {
+                AssertIndexRange(*it, n_cols());
                 if (store_diagonal_first_in_row && *it == row)
                   continue;
                 Assert(k <= rowstart[row + 1],

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.