From 4b22630aa2e518d0fba72118d268c58dbccb4c80 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 18 Nov 2007 05:15:59 +0000 Subject: [PATCH] Add a few assertions. Use operator() instead of el(). This also uncovers a bug since bits/full_matrix_27 now fails. git-svn-id: https://svn.dealii.org/trunk@15510 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/full_matrix.templates.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/deal.II/lac/include/lac/full_matrix.templates.h b/deal.II/lac/include/lac/full_matrix.templates.h index b96923779b..2951ec59a7 100644 --- a/deal.II/lac/include/lac/full_matrix.templates.h +++ b/deal.II/lac/include/lac/full_matrix.templates.h @@ -1568,6 +1568,15 @@ void FullMatrix::add (const FullMatrix &src, const unsigned int src_offset_i, const unsigned int src_offset_j) { + Assert (dst_offset_i < m(), + ExcIndexRange (dst_offset_i, 0, m())); + Assert (dst_offset_j < n(), + ExcIndexRange (dst_offset_j, 0, n())); + Assert (src_offset_i < src.m(), + ExcIndexRange (src_offset_i, 0, src.m())); + Assert (src_offset_j < src.n(), + ExcIndexRange (src_offset_j, 0, src.n())); + // Compute maximal size of copied block const unsigned int rows = (m() - dst_offset_i >= src.m() - src_offset_i) ? src.m() @@ -1578,8 +1587,8 @@ void FullMatrix::add (const FullMatrix &src, for (unsigned int i=0; iel(dst_offset_i+i,dst_offset_j+j) - += factor * src.el(src_offset_i+i,src_offset_j+j); + (*this)(dst_offset_i+i,dst_offset_j+j) + += factor * src(src_offset_i+i,src_offset_j+j); } -- 2.39.5