From 873e5e679e6907daa4e4ab6a6425f4b97809c7bd Mon Sep 17 00:00:00 2001 From: kronbichler Date: Wed, 4 Dec 2013 12:37:13 +0000 Subject: [PATCH] Copy data inside the vector git-svn-id: https://svn.dealii.org/trunk@31875 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/lac/constraint_matrix.templates.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/deal.II/include/deal.II/lac/constraint_matrix.templates.h b/deal.II/include/deal.II/lac/constraint_matrix.templates.h index 177580497b..9566ded083 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.templates.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.templates.h @@ -1307,14 +1307,17 @@ namespace internals const size_type my_length = individual_size[index]; if (my_length == row_length) { - // no space left, need to double row_length - std::vector > - new_data(2*individual_size.size()*row_length*2); - for (size_type i=0; i0; ) + { + --i; + std::move_backward(&data[i*row_length], + &data[i*row_length]+individual_size[i], + &data[i*row_length*2]+individual_size[i]); + } row_length *= 2; } data[index*row_length+my_length] = pair; -- 2.39.5