]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Express memory consumption in std::size_t since this can be quite large numbers.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 4 Feb 2010 15:11:54 +0000 (15:11 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 4 Feb 2010 15:11:54 +0000 (15:11 +0000)
git-svn-id: https://svn.dealii.org/trunk@20496 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparsity_pattern.h
deal.II/lac/source/sparsity_pattern.cc

index d0cc5182f98f68f801b0a2bce003f3864ada3636..1b60e216b3e880856c45d7225c0e01f387d362da 100644 (file)
@@ -1161,7 +1161,7 @@ class SparsityPattern : public Subscriptor
                                      * matrix struct is compressed. It does not
                                      * make too much sense otherwise anyway.
                                      */
-    unsigned int n_nonzero_elements () const;
+    std::size_t n_nonzero_elements () const;
 
                                     /**
                                      * Return whether the structure is
@@ -1379,7 +1379,7 @@ class SparsityPattern : public Subscriptor
                                      * of this object. See
                                      * MemoryConsumption.
                                      */
-    unsigned int memory_consumption () const;
+    std::size_t memory_consumption () const;
 
                                     /**
                                      * This is kind of an expert mode. Get
@@ -2010,7 +2010,7 @@ SparsityPattern::column_number (const unsigned int row,
 
 
 inline
-unsigned int
+std::size_t
 SparsityPattern::n_nonzero_elements () const
 {
   Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());
index 6fed1e7b8a463a6fb6556b8a96ba31943d09dbc4..7ce2b210cc2801ab648e26abe37778deada40ca7 100644 (file)
@@ -1030,11 +1030,11 @@ SparsityPattern::block_read (std::istream &in)
 
 
 
-unsigned int
+std::size_t
 SparsityPattern::memory_consumption () const
 {
-  return (sizeof(*this) +
-         max_dim * sizeof(unsigned int) +
+  return (max_dim * static_cast<size_t>(sizeof(unsigned int)) +
+         sizeof(*this) +
          max_vec_len * sizeof(unsigned int));
 }
 

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.