]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Correct LinearAlgebra::distributed::BlockVector::memory_consumption()
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 7 Nov 2016 11:48:37 +0000 (12:48 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 7 Nov 2016 21:05:14 +0000 (22:05 +0100)
include/deal.II/lac/la_parallel_block_vector.templates.h

index a36c5d4cf417e514edf0c747d089095108af4fcd..d2d02ad1d7586407ab5ffb3e161985ab2fa324a6 100644 (file)
@@ -759,11 +759,9 @@ namespace LinearAlgebra
     std::size_t
     BlockVector<Number>::memory_consumption () const
     {
-      std::size_t mem = sizeof(this->n_blocks());
-      for (size_type i=0; i<this->components.size(); ++i)
-        mem += MemoryConsumption::memory_consumption (this->components[i]);
-      mem += MemoryConsumption::memory_consumption (this->block_indices);
-      return mem;
+      return (MemoryConsumption::memory_consumption (this->block_indices)
+              +
+              MemoryConsumption::memory_consumption (this->components));
     }
 
   } // end of namespace distributed

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.