]> https://gitweb.dealii.org/ - dealii.git/commitdiff
The C++ standard says that 'mutable' can't be applied to reference members, so change...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Sep 2007 03:22:47 +0000 (03:22 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Sep 2007 03:22:47 +0000 (03:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@15241 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/matrix_lib.h
deal.II/lac/include/lac/matrix_lib.templates.h

index 3fb3f244c735d7a81a6d6cd280e3b50870401407..cbc5237c648de82fd3414b7ed4266a90e708c1b8 100644 (file)
@@ -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<VECTOR>mem;
+    mutable VectorMemory<VECTOR>  *mem;
     
                                     /**
                                      * The solver object.
@@ -606,7 +610,8 @@ MeanValueFilter::Tvmult_add(VECTOR&, const VECTOR&) const
 template <class VECTOR>
 template <class MATRIX, class PRECONDITION>
 inline void
-InverseMatrixRichardson<VECTOR>::initialize (const MATRIX& m, const PRECONDITION& p)
+InverseMatrixRichardson<VECTOR>::
+initialize (const MATRIX& m, const PRECONDITION& p)
 {
   if (matrix != 0)
     delete matrix;
index 5eecf2bdd418ffe290bd7452ab88a469b6f03c91..4be1f4e624c5e48a8ba4568bb9bb957d31716aae 100644 (file)
@@ -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<VECTOR>::InverseMatrixRichardson(
   SolverControl& c,
   VectorMemory<VECTOR>& m)
                :
-               mem(m),
+               mem(&m),
                solver(c,m),
                matrix(0),
                precondition(0)
@@ -164,7 +164,7 @@ InverseMatrixRichardson<VECTOR>::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<VECTOR>::vmult_add(VECTOR& dst, const VECTOR& src) const
   catch(...)
     {}  
   dst += *aux;
-  mem.free(aux);
+  mem->free(aux);
 }
 
 
@@ -201,7 +201,7 @@ InverseMatrixRichardson<VECTOR>::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<VECTOR>::Tvmult_add(VECTOR& dst, const VECTOR& src) cons
   catch(...)
     {}  
   dst += *aux;
-  mem.free(aux);
+  mem->free(aux);
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.