]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a few more basic types.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 29 Oct 2010 22:55:08 +0000 (22:55 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 29 Oct 2010 22:55:08 +0000 (22:55 +0000)
git-svn-id: https://svn.dealii.org/trunk@22551 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/memory_consumption.h

index 4b2f3f517fcdbdd3c47baab89c398a032d08d842..970deacc8c70b9a16f97394e2a2e92b897592842 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -16,7 +16,9 @@
 
 #include <base/config.h>
 #include <base/std_cxx1x/shared_ptr.h>
+
 #include <string>
+#include <complex>
 #include <vector>
 #include <utility>
 
@@ -167,6 +169,23 @@ namespace MemoryConsumption
   inline
   unsigned int memory_consumption (const double);
 
+                                  /**
+                                   * Determine the amount of memory
+                                   * in bytes consumed by a <tt>long double</tt>
+                                   * variable.
+                                   */
+  inline
+  unsigned int memory_consumption (const long double);
+
+                                  /**
+                                   * Determine the amount of memory
+                                   * in bytes consumed by a <tt>std::complex</tt>
+                                   * variable.
+                                   */
+  template <typename T>
+  inline
+  unsigned int memory_consumption (const std::complex<T> &);
+
                                   /**
                                    * Determine an estimate of the
                                    * amount of memory in bytes
@@ -468,6 +487,22 @@ namespace MemoryConsumption
 
 
 
+  inline
+  unsigned int memory_consumption (const long double)
+  {
+    return sizeof(long double);
+  }
+
+
+  template <typename T>
+  inline
+  unsigned int memory_consumption (const std::complex<T> &)
+  {
+    return sizeof(std::complex<T>);
+  }
+
+
+
   inline
   unsigned int memory_consumption (const std::string &s)
   {

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.