From: bangerth Date: Sun, 18 Nov 2007 05:15:59 +0000 (+0000) Subject: Add a few assertions. Use operator() instead of el(). This also uncovers a bug since... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=580c28a5b3c1e25ba38416e92cccddcb089aad5d;p=dealii-svn.git 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 --- 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); }