From eef11254409af34bd1a14e8305372de7ddf50726 Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 12 Sep 2002 08:19:47 +0000 Subject: [PATCH] read past end error removed git-svn-id: https://svn.dealii.org/trunk@6401 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/sparse_matrix_ez.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 -- 2.39.5