From: Wolfgang Bangerth Date: Fri, 17 Mar 2000 15:05:00 +0000 (+0000) Subject: Add two assertions. X-Git-Tag: v8.0.0~20779 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2476d86a519364d911e127604a73858fcd2d79e1;p=dealii.git Add two assertions. git-svn-id: https://svn.dealii.org/trunk@2593 0785d39b-7218-0410-832d-ea1e28bc413d --- 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]; };