From 70eab7c4022e0af985d29e6648e3d525929f491c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 5 May 2000 13:37:04 +0000 Subject: [PATCH] Bound the number of elements per row by the total number of columns. git-svn-id: https://svn.dealii.org/trunk@2798 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/sparsity_pattern.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/deal.II/lac/source/sparsity_pattern.cc b/deal.II/lac/source/sparsity_pattern.cc index f2684096ea..49ac236548 100644 --- a/deal.II/lac/source/sparsity_pattern.cc +++ b/deal.II/lac/source/sparsity_pattern.cc @@ -261,11 +261,18 @@ SparsityPattern::reinit (const unsigned int m, // this number is larger than // #max_vec_len#, then we will need // to reallocate memory - const unsigned int vec_len = accumulate (row_lengths.begin(), - row_lengths.end(), 0); + // + // note that the number of elements + // is bounded by the number of + // columns + unsigned int vec_len = 0; + for (unsigned int i=0; i