From 4dfdfdd0d0cedae493797bc65d3bd28207bfb27f Mon Sep 17 00:00:00 2001 From: David Wells Date: Wed, 16 Nov 2022 13:30:31 -0500 Subject: [PATCH] SparsityPattern: add an assertion in input data. --- source/lac/sparsity_pattern.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/lac/sparsity_pattern.cc b/source/lac/sparsity_pattern.cc index 10f0add3e5..8094e9098a 100644 --- a/source/lac/sparsity_pattern.cc +++ b/source/lac/sparsity_pattern.cc @@ -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], -- 2.39.5