From: Wolfgang Bangerth Date: Sat, 9 Feb 2013 21:50:29 +0000 (+0000) Subject: Avoid a bug with the newly introduced general use of always storing the X-Git-Tag: v8.0.0~1382 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcd333fe205291eba749f38367db84f64e72087f;p=dealii.git Avoid a bug with the newly introduced general use of always storing the diagonal of a square matrix. git-svn-id: https://svn.dealii.org/trunk@28297 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/lac/chunk_sparsity_pattern.cc b/deal.II/source/lac/chunk_sparsity_pattern.cc index 2983d2b747..96f6a12386 100644 --- a/deal.II/source/lac/chunk_sparsity_pattern.cc +++ b/deal.II/source/lac/chunk_sparsity_pattern.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2008, 2011, 2012 by the deal.II authors +// Copyright (C) 2008, 2011, 2012, 2013 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -300,14 +300,22 @@ void ChunkSparsityPattern::copy_from (const FullMatrix &matrix, { Assert (chunk_size > 0, ExcInvalidNumber (chunk_size)); - // count number of entries per row, then - // initialize the underlying sparsity - // pattern + // count number of entries per row, then initialize the underlying sparsity + // pattern. remember to also allocate space for the diagonal entry (if that + // hasn't happened yet) if m==n since we always allocate that for diagonal + // matrices std::vector entries_per_row (matrix.m(), 0); for (unsigned int row=0; row