From b39550cce5bee8ff3bf4e8ed3d546398df78974a Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 26 Sep 2007 15:14:05 +0000 Subject: [PATCH] Undo the last patch: we don't need anything to be mutable here at all since we don't modify the variable -- only the object the reference points to. constness isn't inherited from member functions to the pointed to object. git-svn-id: https://svn.dealii.org/trunk@15248 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, 9 insertions(+), 14 deletions(-) diff --git a/deal.II/lac/include/lac/matrix_lib.h b/deal.II/lac/include/lac/matrix_lib.h index cbc5237c64..a06883415c 100644 --- a/deal.II/lac/include/lac/matrix_lib.h +++ b/deal.II/lac/include/lac/matrix_lib.h @@ -411,14 +411,10 @@ class InverseMatrixRichardson : public Subscriptor private: /** - * Access to the provided + * A reference to the provided * VectorMemory object. - * - * Declared as a pointer instead of a - * reference because C++ doesn't allow - * mutable references. */ - mutable VectorMemory *mem; + VectorMemory &mem; /** * The solver object. @@ -610,8 +606,7 @@ 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 4be1f4e624..5eecf2bdd4 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, 2007 by the deal.II authors +// Copyright (C) 2002, 2003, 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 @@ -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