]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add forgotten memory_consumption function.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Nov 2000 12:42:48 +0000 (12:42 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Nov 2000 12:42:48 +0000 (12:42 +0000)
git-svn-id: https://svn.dealii.org/trunk@3504 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_constraints.h
deal.II/deal.II/source/dofs/dof_constraints.cc

index 62999bfb9edb88c72cd35bf25e283df9da92db22..743b48809c65478d29e6f3ae0a40ff5dae84f69f 100644 (file)
@@ -476,6 +476,13 @@ class ConstraintMatrix : public Subscriptor
                                          * relation.
                                          */
        bool operator < (const ConstraintLine &) const;
+
+                                        /**
+                                         * Determine an estimate for the
+                                         * memory consumption (in bytes)
+                                         * of this object.
+                                         */
+       unsigned int memory_consumption () const;
     };
 
                                     /**
index d6975d3bdb8527b83fb6641a823ff2637b0732c0..44ef42930505187767f5ff876de5f825bd2298b7 100644 (file)
@@ -15,6 +15,7 @@
 #include <dofs/dof_constraints.h>
 #include <dofs/dof_constraints.templates.h>
 
+#include <base/memory_consumption.h>
 #include <lac/sparsity_pattern.h>
 #include <lac/vector.h>
 #include <lac/block_vector.h>
@@ -34,6 +35,15 @@ ConstraintMatrix::ConstraintLine::operator < (const ConstraintLine &a) const
 
 
 
+unsigned int
+ConstraintMatrix::ConstraintLine::memory_consumption () const
+{
+  return (MemoryConsumption::memory_consumption (line) +
+         MemoryConsumption::memory_consumption (entries));
+};
+
+
+
 ConstraintMatrix::ConstraintMatrix () :
                lines(),
                sorted(false)
@@ -601,7 +611,8 @@ unsigned int ConstraintMatrix::max_constraint_indirections () const
 
     
 
-void ConstraintMatrix::print (ostream &out) const {
+void ConstraintMatrix::print (ostream &out) const
+{
   for (unsigned int i=0; i!=lines.size(); ++i)
     for (unsigned int j=0; j!=lines[i].entries.size(); ++j)
       out << "    " << lines[i].line
@@ -613,6 +624,15 @@ void ConstraintMatrix::print (ostream &out) const {
 
 
 
+unsigned int
+ConstraintMatrix::memory_consumption () const
+{
+  return (MemoryConsumption::memory_consumption (lines) +
+         MemoryConsumption::memory_consumption (sorted));
+};
+
+
+
 
 
 // explicit instantiations

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.