From 8c06c72be9841dd8a8df77f4ebd480206980e1e0 Mon Sep 17 00:00:00 2001 From: Ralf Hartmann Date: Mon, 27 Feb 2006 12:49:21 +0000 Subject: [PATCH] Fix fill function. See tests/lac/lapack_fill. git-svn-id: https://svn.dealii.org/trunk@12509 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/lapack_full_matrix.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/deal.II/lac/include/lac/lapack_full_matrix.h b/deal.II/lac/include/lac/lapack_full_matrix.h index 1c4d52208a..95e9960d21 100644 --- a/deal.II/lac/include/lac/lapack_full_matrix.h +++ b/deal.II/lac/include/lac/lapack_full_matrix.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2005 by the deal.II authors +// Copyright (C) 2005, 2006 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -344,20 +344,17 @@ LAPACKFullMatrix::fill ( const unsigned int src_offset_i, const unsigned int src_offset_j) { - const unsigned int endcol = src_offset_j + this->n_cols(); - - const typename MATRIX::const_iterator - end = M.end(src_offset_i+this->n_rows()-dst_offset_i-1); + const typename MATRIX::const_iterator end = M.end(); for (typename MATRIX::const_iterator entry = M.begin(src_offset_i); entry != end; ++entry) { const unsigned int i = entry->row(); const unsigned int j = entry->column(); - - if (j >= src_offset_j && j < endcol) - this->operator()(dst_offset_i-src_offset_i+i, - dst_offset_j-src_offset_j+j) - = entry->value(); + + const unsigned int dst_i=dst_offset_i+i-src_offset_i; + const unsigned int dst_j=dst_offset_j+j-src_offset_j; + if (dst_in_rows() && dst_jn_cols()) + (*this)(dst_i, dst_j) = entry->value(); } state = LAPACKSupport::matrix; -- 2.39.5