From 51fd8e47b7b19f821b524103c006d4ed6e09e7ac Mon Sep 17 00:00:00 2001 From: prill Date: Fri, 25 Jan 2008 20:38:43 +0000 Subject: [PATCH] Moved BlockVector::memory_consumption to BlockVectorBase class. git-svn-id: https://svn.dealii.org/trunk@15688 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/block_vector.h | 9 +-------- deal.II/lac/include/lac/block_vector.templates.h | 13 ------------- deal.II/lac/include/lac/block_vector_base.h | 15 +++++++++------ 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/deal.II/lac/include/lac/block_vector.h b/deal.II/lac/include/lac/block_vector.h index 26189d0f4f..d948a30941 100644 --- a/deal.II/lac/include/lac/block_vector.h +++ b/deal.II/lac/include/lac/block_vector.h @@ -380,14 +380,7 @@ class BlockVector : public BlockVectorBase > */ 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 * @{ */ /** diff --git a/deal.II/lac/include/lac/block_vector.templates.h b/deal.II/lac/include/lac/block_vector.templates.h index bfd7b18f9c..89f82a6f93 100644 --- a/deal.II/lac/include/lac/block_vector.templates.h +++ b/deal.II/lac/include/lac/block_vector.templates.h @@ -15,7 +15,6 @@ #include -#include #include #include #include @@ -154,18 +153,6 @@ void BlockVector::block_read (std::istream &in) } -template -unsigned int -BlockVector::memory_consumption () const -{ - unsigned int mem = sizeof(this->n_blocks()); - for (unsigned int i=0; icomponents.size(); ++i) - mem += MemoryConsumption::memory_consumption (this->components[i]); - mem += MemoryConsumption::memory_consumption (this->block_indices); - return mem; -} - - DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/lac/include/lac/block_vector_base.h b/deal.II/lac/include/lac/block_vector_base.h index 516d0c18e5..7887ef7cc1 100644 --- a/deal.II/lac/include/lac/block_vector_base.h +++ b/deal.II/lac/include/lac/block_vector_base.h @@ -17,9 +17,9 @@ #include #include #include +#include #include #include - #include #include #include @@ -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::equ (const value_type a, template unsigned int BlockVectorBase::memory_consumption () const { - AssertThrow(false, ExcNotImplemented() ); - return 0; + unsigned int mem = sizeof(this->n_blocks()); + for (unsigned int i=0; icomponents.size(); ++i) + mem += MemoryConsumption::memory_consumption (this->components[i]); + mem += MemoryConsumption::memory_consumption (this->block_indices); + return mem; } -- 2.39.5