From: Wolfgang Bangerth Date: Thu, 4 Sep 2003 20:22:35 +0000 (+0000) Subject: Fix a problem with copy_from and SparseMatrix. From the mailing list: X-Git-Tag: v8.0.0~16252 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b109caf1886780f4430c15b503415a64e92ab31;p=dealii.git Fix a problem with copy_from and SparseMatrix. From the mailing list: minor bug in full_matrix.h From: "Ralf B. Schulz" (DKFZ) To: dealii@dealii.org Date: Mon Aug 18 07:15:28 2003 FullMatrix<>::copy_from(MATRIX &) fails for MATRIX = SparseMatrix as there is no default constructor for the const_iterator, and probably also no copy constructor. Attached is a small patch for full_matrix.h that solves the problem by putting the declaration of the iterator into the loop initializer. Best, Ralf git-svn-id: https://svn.dealii.org/trunk@7958 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index 30837e2c8d..3276f2bb97 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -935,9 +935,9 @@ void FullMatrix::copy_from (const MATRIX& M) { reinit (M.m(), M.n()); - typename MATRIX::const_iterator entry; const typename MATRIX::const_iterator end = M.end(); - for (entry = M.begin(); entry != end; ++entry) + for (typename MATRIX::const_iterator entry = M.begin(); + entry != end; ++entry) el(entry->row(), entry->column()) = entry->value(); }