]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Set matrix size by std::size_t, not unsigned int, since on very large matrices with...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Feb 2010 15:13:00 +0000 (15:13 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Feb 2010 15:13:00 +0000 (15:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@20497 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparse_matrix.h
deal.II/lac/include/lac/sparse_matrix.templates.h

index 4759efb28cd09535692911a6d3289f73fb073e2f..adeb294d951d2ae17956b60d4676ce5ac6b42f3e 100644 (file)
@@ -797,7 +797,7 @@ class SparseMatrix : public virtual Subscriptor
                                      * of this object. See
                                      * MemoryConsumption.
                                      */
-    unsigned int memory_consumption () const;
+    std::size_t memory_consumption () const;
 
 //@}
 /**
@@ -2100,7 +2100,7 @@ class SparseMatrix : public virtual Subscriptor
                                      * object, using the reinit()
                                      * function.
                                      */
-    unsigned int max_len;
+    std::size_t max_len;
 
                                     // make all other sparse matrices
                                     // friends
index 204443ee5cc1f75f48cca17458e1f47843f48faa..e2c70d60b90da964b58308277d838142f7b3a885 100644 (file)
@@ -176,7 +176,7 @@ SparseMatrix<number>::reinit (const SparsityPattern &sparsity)
       return;
     }
 
-  const unsigned int N = cols->n_nonzero_elements();
+  const std::size_t N = cols->n_nonzero_elements();
   if (N > max_len || max_len == 0)
     {
       if (val != 0)
@@ -1885,10 +1885,10 @@ SparseMatrix<number>::block_read (std::istream &in)
 
 
 template <typename number>
-unsigned int
+std::size_t
 SparseMatrix<number>::memory_consumption () const
 {
-  return sizeof(*this) + max_len*sizeof(number);
+  return max_len*static_cast<std::size_t>(sizeof(number)) + sizeof(*this);
 }
 
 

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.