From 91bc6d3e25f2703e911a0fde4f20786ec47a9cf5 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 27 Nov 2000 12:42:48 +0000 Subject: [PATCH] Add forgotten memory_consumption function. git-svn-id: https://svn.dealii.org/trunk@3504 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/dofs/dof_constraints.h | 7 ++++++ .../deal.II/source/dofs/dof_constraints.cc | 22 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/include/dofs/dof_constraints.h b/deal.II/deal.II/include/dofs/dof_constraints.h index 62999bfb9e..743b48809c 100644 --- a/deal.II/deal.II/include/dofs/dof_constraints.h +++ b/deal.II/deal.II/include/dofs/dof_constraints.h @@ -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; }; /** diff --git a/deal.II/deal.II/source/dofs/dof_constraints.cc b/deal.II/deal.II/source/dofs/dof_constraints.cc index d6975d3bdb..44ef429305 100644 --- a/deal.II/deal.II/source/dofs/dof_constraints.cc +++ b/deal.II/deal.II/source/dofs/dof_constraints.cc @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -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 -- 2.39.5