From 4460f478385b24d011955670e06760b813aa17ad Mon Sep 17 00:00:00 2001 From: wolf Date: Sat, 11 Aug 2001 22:04:31 +0000 Subject: [PATCH] Add some assertions. git-svn-id: https://svn.dealii.org/trunk@4876 0785d39b-7218-0410-832d-ea1e28bc413d --- .../lac/include/lac/sparse_matrix.templates.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/deal.II/lac/include/lac/sparse_matrix.templates.h b/deal.II/lac/include/lac/sparse_matrix.templates.h index 7763ded034..f05c92f9b8 100644 --- a/deal.II/lac/include/lac/sparse_matrix.templates.h +++ b/deal.II/lac/include/lac/sparse_matrix.templates.h @@ -723,13 +723,15 @@ SparseMatrix::threaded_residual (Vector &dst, template template void -SparseMatrix::precondition_Jacobi (Vector& dst, - const Vector& src, - const number om) const +SparseMatrix::precondition_Jacobi (Vector &dst, + const Vector &src, + const number om) const { Assert (cols != 0, ExcMatrixNotInitialized()); Assert (val != 0, ExcMatrixNotInitialized()); Assert (m() == n(), ExcMatrixNotSquare()); + Assert (dst.size() == n(), ExcDimensionMismatch (dst.size(), n())); + Assert (src.size() == n(), ExcDimensionMismatch (src.size(), n())); const unsigned int n = src.size(); somenumber *dst_ptr = dst.begin(); @@ -749,9 +751,9 @@ SparseMatrix::precondition_Jacobi (Vector& dst, template template void -SparseMatrix::precondition_SSOR (Vector& dst, - const Vector& src, - const number om) const +SparseMatrix::precondition_SSOR (Vector &dst, + const Vector &src, + const number om) const { // to understand how this function works // you may want to take a look at the CVS @@ -760,6 +762,8 @@ SparseMatrix::precondition_SSOR (Vector& dst, Assert (cols != 0, ExcMatrixNotInitialized()); Assert (val != 0, ExcMatrixNotInitialized()); Assert (m() == n(), ExcMatrixNotSquare()); + Assert (dst.size() == n(), ExcDimensionMismatch (dst.size(), n())); + Assert (src.size() == n(), ExcDimensionMismatch (src.size(), n())); const unsigned int n = src.size(); const unsigned int *rowstart_ptr = &cols->rowstart[0]; -- 2.39.5