]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Moved BlockVector::memory_consumption to BlockVectorBase class.
authorprill <prill@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 25 Jan 2008 20:38:43 +0000 (20:38 +0000)
committerprill <prill@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 25 Jan 2008 20:38:43 +0000 (20:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@15688 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 26189d0f4ffa3c738c38a00fdc74508cbe6b474d..d948a309415be6d2ecf91457f105af533fa643e5 100644 (file)
@@ -380,14 +380,7 @@ class BlockVector : public BlockVectorBase<Vector<Number> >
                                      */
     void block_read (std::istream &in);
 
-                                    /**
-                                     * Determine an estimate for the
-                                     * memory consumption (in bytes)
-                                     * of this object.
-                                     */
-    unsigned int memory_consumption () const;
-
-                                    /** @addtogroup Exceptions
+                                    /** @addtogroup Exceptions
                                      * @{ */
     
                                     /**
index bfd7b18f9c99d053bf8c95bc9f06daf923b40b4d..89f82a6f93d0374cf64fa32b5120102fa4762941 100644 (file)
@@ -15,7 +15,6 @@
 
 
 #include <base/config.h>
-#include <base/memory_consumption.h>
 #include <lac/block_vector.h>
 #include <cmath>
 #include <algorithm>
@@ -154,18 +153,6 @@ void BlockVector<Number>::block_read (std::istream &in)
 }
 
 
-template <typename Number>
-unsigned int
-BlockVector<Number>::memory_consumption () const
-{
-  unsigned int mem = sizeof(this->n_blocks());
-  for (unsigned int i=0; i<this->components.size(); ++i)
-    mem += MemoryConsumption::memory_consumption (this->components[i]);
-  mem += MemoryConsumption::memory_consumption (this->block_indices);
-  return mem;
-}
-
-
 
 DEAL_II_NAMESPACE_CLOSE
 
index 516d0c18e56b12cd8477f4e152a6f3bce5611afa..7887ef7cc1d56fdb308c5f27a9174c7ee8638139 100644 (file)
@@ -17,9 +17,9 @@
 #include <base/config.h>
 #include <base/exceptions.h>
 #include <base/subscriptor.h>
+#include <base/memory_consumption.h>
 #include <lac/exceptions.h>
 #include <lac/block_indices.h>
-
 #include <vector>
 #include <iterator>
 #include <cmath>
@@ -1001,9 +1001,9 @@ class BlockVectorBase : public Subscriptor
              const value_type b, const BlockVectorBase& W);
 
                                     /**
-                                     * Estimate for the memory
-                                     * consumption (not implemented
-                                     * for this class).
+                                     * Determine an estimate for the
+                                     * memory consumption (in bytes)
+                                     * of this object.
                                      */
     unsigned int memory_consumption () const;
       
@@ -2083,8 +2083,11 @@ void BlockVectorBase<VectorType>::equ (const value_type a,
 template <class VectorType>
 unsigned int BlockVectorBase<VectorType>::memory_consumption () const
 {
-  AssertThrow(false, ExcNotImplemented() );
-  return 0;
+  unsigned int mem = sizeof(this->n_blocks());
+  for (unsigned int i=0; i<this->components.size(); ++i)
+    mem += MemoryConsumption::memory_consumption (this->components[i]);
+  mem += MemoryConsumption::memory_consumption (this->block_indices);
+  return mem;
 }
 
 

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.