From: Lei Qiao Date: Fri, 21 Aug 2015 23:38:50 +0000 (-0500) Subject: let SparseMatrixEZ not reset memory allocation paramters in copy_from() X-Git-Tag: v8.4.0-rc2~559^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1416%2Fhead;p=dealii.git let SparseMatrixEZ not reset memory allocation paramters in copy_from() --- diff --git a/include/deal.II/lac/sparse_matrix_ez.h b/include/deal.II/lac/sparse_matrix_ez.h index 303e1d2bb8..ad4f3b2c5e 100644 --- a/include/deal.II/lac/sparse_matrix_ez.h +++ b/include/deal.II/lac/sparse_matrix_ez.h @@ -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 & SparseMatrixEZ::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 diff --git a/include/deal.II/lac/sparse_matrix_ez.templates.h b/include/deal.II/lac/sparse_matrix_ez.templates.h index a83883548d..bacd822d5c 100644 --- a/include/deal.II/lac/sparse_matrix_ez.templates.h +++ b/include/deal.II/lac/sparse_matrix_ez.templates.h @@ -102,6 +102,7 @@ SparseMatrixEZ::reinit(const size_type n_rows, { clear(); + saved_default_row_length = default_row_length; increment = default_increment; n_columns = n_cols;