From 68a6c490b57deb2e70b0c818086c3cd4f91602fd Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 30 Jul 2008 21:42:30 +0000 Subject: [PATCH] Fix a bug in copy_from(FullMatrix) git-svn-id: https://svn.dealii.org/trunk@16454 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/sparsity_pattern.cc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/deal.II/lac/source/sparsity_pattern.cc b/deal.II/lac/source/sparsity_pattern.cc index 071ca537ce..4ae2ff6fa5 100644 --- a/deal.II/lac/source/sparsity_pattern.cc +++ b/deal.II/lac/source/sparsity_pattern.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -653,13 +653,23 @@ template void SparsityPattern::copy_from (const FullMatrix &matrix, const bool optimize_diag) { - // first init with the number of - // entries per row + // first init with the number of entries + // per row. if optimize_diag is set then we + // also have to allocate memory for the + // diagonal entry, unless we have already + // counted it std::vector entries_per_row (matrix.m(), 0); for (unsigned int row=0; row