]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix bug and reintroduce old constructor with "explicit"
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 12 Aug 2011 23:24:31 +0000 (23:24 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 12 Aug 2011 23:24:31 +0000 (23:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@24059 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/block_indices.h

index 0be0b045e369b5ef83ce261c677b7db9a781335a..ca481c2e9b1678192764792368221cc6b023c82b 100644 (file)
@@ -70,7 +70,7 @@ class BlockIndices : public Subscriptor
                                      * Specialized constructor for a
                                      * structure with blocks of equal size.
                                      */
-    BlockIndices(const unsigned int n_blocks, const unsigned int block_size);
+    explicit BlockIndices(const unsigned int n_blocks, const unsigned int block_size = 0);
     
                                     /**
                                      * Reinitialize the number of
@@ -339,10 +339,10 @@ BlockIndices::reinit (const std::vector<unsigned int> &n)
 
 
 inline
-BlockIndices::BlockIndices (/*const unsigned int n_blocks*/)
+BlockIndices::BlockIndices ()
                :
-               n_blocks(0/*n_blocks*/)//,
-//             start_indices(n_blocks+1, 0)
+               n_blocks(0),
+               start_indices(1, 0)
 {}
 
 
@@ -413,6 +413,7 @@ inline
 unsigned int
 BlockIndices::total_size () const 
 {
+  if (n_blocks == 0) return 0;
   return start_indices[n_blocks];
 }
 

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.