From cb50c4eaadace60dcdb466e06aeae4fe7cbc5633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= <graeser@mi.fu-berlin.de> Date: Sat, 31 Mar 2012 23:03:13 +0000 Subject: [PATCH] The rhs vector should be const The rhs_ member is the real rhs_ and not the residual. It actually was already const semantically. [[Imported from SVN: r5811]] --- dune/solvers/iterationsteps/blockgsstep.hh | 2 +- dune/solvers/iterationsteps/lineariterationstep.hh | 6 +++--- dune/solvers/iterationsteps/multigridstep.hh | 2 +- dune/solvers/iterationsteps/projectedblockgsstep.hh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dune/solvers/iterationsteps/blockgsstep.hh b/dune/solvers/iterationsteps/blockgsstep.hh index 70353bc0..2f73df80 100644 --- a/dune/solvers/iterationsteps/blockgsstep.hh +++ b/dune/solvers/iterationsteps/blockgsstep.hh @@ -28,7 +28,7 @@ template<class OperatorType, BlockGSStep() {} //! Constructor with a linear problem - BlockGSStep(const OperatorType& mat, DiscFuncType& x, DiscFuncType& rhs) + BlockGSStep(const OperatorType& mat, DiscFuncType& x, const DiscFuncType& rhs) : LinearIterationStep<OperatorType,DiscFuncType>(mat, x, rhs) {} diff --git a/dune/solvers/iterationsteps/lineariterationstep.hh b/dune/solvers/iterationsteps/lineariterationstep.hh index 0313a622..8157405b 100644 --- a/dune/solvers/iterationsteps/lineariterationstep.hh +++ b/dune/solvers/iterationsteps/lineariterationstep.hh @@ -20,14 +20,14 @@ public: virtual ~LinearIterationStep() {} //! Constructor being given linear operator, solution and right hand side - LinearIterationStep(const MatrixType& mat, VectorType& x, VectorType& rhs) { + LinearIterationStep(const MatrixType& mat, VectorType& x, const VectorType& rhs) { mat_ = &mat; this->x_ = &x; rhs_ = &rhs; } //! Set linear operator, solution and right hand side - virtual void setProblem(const MatrixType& mat, VectorType& x, VectorType& rhs) { + virtual void setProblem(const MatrixType& mat, VectorType& x, const VectorType& rhs) { this->x_ = &x; rhs_ = &rhs; mat_ = &mat; @@ -57,7 +57,7 @@ public: } //! The container for the right hand side - VectorType* rhs_; + const VectorType* rhs_; //! The linear operator const MatrixType* mat_; diff --git a/dune/solvers/iterationsteps/multigridstep.hh b/dune/solvers/iterationsteps/multigridstep.hh index c18a4613..e871019f 100644 --- a/dune/solvers/iterationsteps/multigridstep.hh +++ b/dune/solvers/iterationsteps/multigridstep.hh @@ -133,7 +133,7 @@ virtual void setProblem(const MatrixType& mat, VectorType& x, - VectorType& rhs) + const VectorType& rhs) { level_ = numLevels_-1; diff --git a/dune/solvers/iterationsteps/projectedblockgsstep.hh b/dune/solvers/iterationsteps/projectedblockgsstep.hh index 58f7419e..e5b25414 100644 --- a/dune/solvers/iterationsteps/projectedblockgsstep.hh +++ b/dune/solvers/iterationsteps/projectedblockgsstep.hh @@ -22,7 +22,7 @@ public: ProjectedBlockGSStep() {} //! Constructor with a linear problem - ProjectedBlockGSStep(const OperatorType& mat, DiscFuncType& x, DiscFuncType& rhs) + ProjectedBlockGSStep(const OperatorType& mat, DiscFuncType& x, const DiscFuncType& rhs) : BlockGSStep<OperatorType,DiscFuncType>(mat, x, rhs) {} -- GitLab