]> https://gitweb.dealii.org/ - dealii.git/commitdiff
let SparseMatrixEZ not reset memory allocation paramters in copy_from() 1416/head
authorLei Qiao <qiaol618@gmail.com>
Fri, 21 Aug 2015 23:38:50 +0000 (18:38 -0500)
committerLei Qiao <qiaol618@gmail.com>
Sat, 22 Aug 2015 00:44:26 +0000 (19:44 -0500)
include/deal.II/lac/sparse_matrix_ez.h
include/deal.II/lac/sparse_matrix_ez.templates.h

index 303e1d2bb84cece19876914ab0b5b2841c4eb86b..ad4f3b2c5ef1350719e328265ea6bf104d10d9aa 100644 (file)
@@ -858,6 +858,11 @@ private:
    * Increment when a row grows.
    */
   unsigned int increment;
+
+  /**
+   * Remember the user provided default row length.
+   */
+  unsigned int saved_default_row_length;
 };
 
 /**
@@ -1392,7 +1397,10 @@ inline
 SparseMatrixEZ<number> &
 SparseMatrixEZ<number>::copy_from (const MATRIX &M, const bool elide_zero_values)
 {
-  reinit(M.m(), M.n());
+  reinit(M.m(),
+         M.n(),
+         this->saved_default_row_length,
+         this->increment);
 
   // loop over the elements of the argument matrix row by row, as suggested
   // in the documentation of the sparse matrix iterator class, and
index a83883548d29545e4b6099aed1348607d213fe2e..bacd822d5ce147e733d777a9a5e92b3b762b3cdb 100644 (file)
@@ -102,6 +102,7 @@ SparseMatrixEZ<number>::reinit(const size_type n_rows,
 {
   clear();
 
+  saved_default_row_length = default_row_length;
   increment = default_increment;
 
   n_columns = n_cols;

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.