From: wolf Date: Fri, 17 Mar 2000 15:05:00 +0000 (+0000) Subject: Add two assertions. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ec5f87ef3e2974f19fd70f569c9b0f43b8a84f4;p=dealii-svn.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]; };