From 5ec5f87ef3e2974f19fd70f569c9b0f43b8a84f4 Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 17 Mar 2000 15:05:00 +0000 Subject: [PATCH] Add two assertions. git-svn-id: https://svn.dealii.org/trunk@2593 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/sparse_matrix.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deal.II/lac/include/lac/sparse_matrix.h b/deal.II/lac/include/lac/sparse_matrix.h index 3fcc408d62..ce27fd0a1e 100644 --- a/deal.II/lac/include/lac/sparse_matrix.h +++ b/deal.II/lac/include/lac/sparse_matrix.h @@ -764,7 +764,8 @@ SparseMatrix::raw_entry (const unsigned int row, const unsigned int index) const { Assert(rowrows, ExcIndexRange(row,0,cols->rows)); - Assert(indexrow_length(row), ExcIndexRange(index,0,cols->row_length(row))); + Assert(indexrow_length(row), + ExcIndexRange(index,0,cols->row_length(row))); return val[cols->rowstart[row]+index]; }; @@ -775,6 +776,9 @@ inline number SparseMatrix::global_entry (const unsigned int j) const { Assert (cols != 0, ExcMatrixNotInitialized()); + Assert (j < cols->n_nonzero_elements(), + ExcIndexRange (j, 0, cols->n_nonzero_elements())); + return val[j]; }; @@ -784,6 +788,9 @@ inline number & SparseMatrix::global_entry (const unsigned int j) { Assert (cols != 0, ExcMatrixNotInitialized()); + Assert (j < cols->n_nonzero_elements(), + ExcIndexRange (j, 0, cols->n_nonzero_elements())); + return val[j]; }; -- 2.39.5