From: guido Date: Thu, 12 Sep 2002 08:19:47 +0000 (+0000) Subject: read past end error removed X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eef11254409af34bd1a14e8305372de7ddf50726;p=dealii-svn.git read past end error removed git-svn-id: https://svn.dealii.org/trunk@6401 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/sparse_matrix_ez.h b/deal.II/lac/include/lac/sparse_matrix_ez.h index b296b54386..20053ebdc4 100644 --- a/deal.II/lac/include/lac/sparse_matrix_ez.h +++ b/deal.II/lac/include/lac/sparse_matrix_ez.h @@ -1177,10 +1177,9 @@ SparseMatrixEZ::allocate (const unsigned int row, // Find position of entry while (icolumn == col) - return entry; + if (i != end && data[i].column == col) + return &data[i]; // Now, we must insert the new // entry and move all successive @@ -1195,7 +1194,6 @@ SparseMatrixEZ::allocate (const unsigned int row, { // Insert new entries data.insert(data.begin()+end, increment, Entry()); - entry = &data[i]; // Update starts of // following rows for (unsigned int rn=row+1;rn::allocate (const unsigned int row, // does not increase // performance. data.push_back(Entry()); - entry = &data[i]; } } + Entry* entry = &data[i]; // Save original entry Entry temp = *entry; // Insert new entry here to