From: wolf Date: Fri, 5 May 2000 13:37:04 +0000 (+0000) Subject: Bound the number of elements per row by the total number of columns. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8be66da704d6728d4d798389eff7e677259faad9;p=dealii-svn.git 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 --- 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