]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a few assertions. Use operator() instead of el(). This also uncovers a bug since...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 18 Nov 2007 05:15:59 +0000 (05:15 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 18 Nov 2007 05:15:59 +0000 (05:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@15510 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/full_matrix.templates.h

index b96923779b42a8870d9e9b7d8b5fadde4343897c..2951ec59a7ab3cc97aed2a9e28fb481e71c14f24 100644 (file)
@@ -1568,6 +1568,15 @@ void FullMatrix<number>::add (const FullMatrix<number2> &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<number>::add (const FullMatrix<number2> &src,
   
   for (unsigned int i=0; i<rows ; ++i)
     for (unsigned int j=0; j<cols ; ++j)
-      this->el(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);
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.