]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add check.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Nov 1999 09:04:02 +0000 (09:04 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Nov 1999 09:04:02 +0000 (09:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@1867 0785d39b-7218-0410-832d-ea1e28bc413d

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

index a6fff6d381a574dbcec8381d84de5c239becb684..1e4e8f1a393bc9de8bb898a863c5227b5a0c440a 100644 (file)
@@ -73,13 +73,16 @@ template <int n_blocks, typename Number>
 void BlockVector<n_blocks, Number>::reinit (const vector<unsigned int>& n,
                                            const bool fast)
 {
+  Assert (n.size() == n_blocks,
+         ExcDimensionsDontMatch(n.size(), n_blocks));
+  
   unsigned int j=0;
   start[0] = j;
-  for (unsigned int i=0;i<n_blocks;)
+  for (unsigned int i=0; i<n_blocks; ++i)
     {
       components[i].reinit(n[i], fast);
       j += n[i];
-      start[++i] = j;
+      start[i+1] = 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.