From 81efe5167f329a5ea6f5a43cfdf736db9a93c9c3 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 3 Nov 2016 11:57:28 -0500 Subject: [PATCH] Fix BlockVectorBase::memory_consumption. The existing implementation forgot to add the memory required for the std::vector of blocks, it only added the memory required for the blocks themselves. It turns out that fixing this also allows to simplify the code significantly. --- include/deal.II/lac/block_vector_base.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index 0bc19dd96a..7ebd90efbe 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -2049,11 +2049,9 @@ template std::size_t BlockVectorBase::memory_consumption () const { - std::size_t mem = MemoryConsumption::memory_consumption (this->block_indices); - for (size_type i=0; icomponents.size(); ++i) - mem += MemoryConsumption::memory_consumption (this->components[i]); - - return mem; + return (MemoryConsumption::memory_consumption (this->block_indices) + + + MemoryConsumption::memory_consumption (this->components)); } -- 2.39.5