]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
assertions added
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Oct 2001 08:12:38 +0000 (08:12 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Oct 2001 08:12:38 +0000 (08:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@5151 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_sparsity_pattern.h

index 34e71fb401cad5b3d33a25f0a5b6a389c62e41dd..a7715bb98718df09df9ca8d62370eb95a9b8f5b9 100644 (file)
@@ -331,6 +331,10 @@ class BlockSparsityPatternBase : public Subscriptor
                    int, int,
                    << "The number of blocks " << arg1 << " and " << arg2
                    << " are different.");
+                                    /**
+                                     * Exception
+                                     */
+    DeclException0 (ExcInvalidConstructorCall);
     
   protected:
 
@@ -494,6 +498,8 @@ SparsityPatternBase &
 BlockSparsityPatternBase<SparsityPatternBase>::block (const unsigned int row,
                                                  const unsigned int column)
 {
+  Assert (row<rows, ExcIndexRange(row,0,rows));
+  Assert (column<columns, ExcIndexRange(column,0,columns));
   return *sub_objects[row][column];
 };
 
@@ -505,6 +511,8 @@ const SparsityPatternBase &
 BlockSparsityPatternBase<SparsityPatternBase>::block (const unsigned int row,
                             const unsigned int column) const
 {
+  Assert (row<rows, ExcIndexRange(row,0,rows));
+  Assert (column<columns, ExcIndexRange(column,0,columns));
   return *sub_objects[row][column];
 };
 

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.