From ed239f763c81cce6dc99ad615ff8cbd1af58222e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 26 Sep 2007 03:22:47 +0000 Subject: [PATCH] The C++ standard says that 'mutable' can't be applied to reference members, so change things to a pointer instead. git-svn-id: https://svn.dealii.org/trunk@15241 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/matrix_lib.h | 11 ++++++++--- deal.II/lac/include/lac/matrix_lib.templates.h | 12 ++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/deal.II/lac/include/lac/matrix_lib.h b/deal.II/lac/include/lac/matrix_lib.h index 3fb3f244c7..cbc5237c64 100644 --- a/deal.II/lac/include/lac/matrix_lib.h +++ b/deal.II/lac/include/lac/matrix_lib.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -413,8 +413,12 @@ class InverseMatrixRichardson : public Subscriptor /** * Access to the provided * VectorMemory object. + * + * Declared as a pointer instead of a + * reference because C++ doesn't allow + * mutable references. */ - mutable VectorMemory& mem; + mutable VectorMemory *mem; /** * The solver object. @@ -606,7 +610,8 @@ MeanValueFilter::Tvmult_add(VECTOR&, const VECTOR&) const template template inline void -InverseMatrixRichardson::initialize (const MATRIX& m, const PRECONDITION& p) +InverseMatrixRichardson:: +initialize (const MATRIX& m, const PRECONDITION& p) { if (matrix != 0) delete matrix; diff --git a/deal.II/lac/include/lac/matrix_lib.templates.h b/deal.II/lac/include/lac/matrix_lib.templates.h index 5eecf2bdd4..4be1f4e624 100644 --- a/deal.II/lac/include/lac/matrix_lib.templates.h +++ b/deal.II/lac/include/lac/matrix_lib.templates.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2002, 2003, 2005, 2006 by the deal.II authors +// Copyright (C) 2002, 2003, 2005, 2006, 2007 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -126,7 +126,7 @@ InverseMatrixRichardson::InverseMatrixRichardson( SolverControl& c, VectorMemory& m) : - mem(m), + mem(&m), solver(c,m), matrix(0), precondition(0) @@ -164,7 +164,7 @@ InverseMatrixRichardson::vmult_add(VECTOR& dst, const VECTOR& src) const { Assert (matrix != 0, ExcNotInitialized()); Assert (precondition != 0, ExcNotInitialized()); - VECTOR* aux = mem.alloc(); + VECTOR* aux = mem->alloc(); aux->reinit(dst); try { @@ -173,7 +173,7 @@ InverseMatrixRichardson::vmult_add(VECTOR& dst, const VECTOR& src) const catch(...) {} dst += *aux; - mem.free(aux); + mem->free(aux); } @@ -201,7 +201,7 @@ InverseMatrixRichardson::Tvmult_add(VECTOR& dst, const VECTOR& src) cons { Assert (matrix != 0, ExcNotInitialized()); Assert (precondition != 0, ExcNotInitialized()); - VECTOR* aux = mem.alloc(); + VECTOR* aux = mem->alloc(); aux->reinit(dst); try { @@ -210,7 +210,7 @@ InverseMatrixRichardson::Tvmult_add(VECTOR& dst, const VECTOR& src) cons catch(...) {} dst += *aux; - mem.free(aux); + mem->free(aux); } -- 2.39.5