From aff51273b0ee061178e1dac1ae55a3e312fc0c3f Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt <Ansgar.Burchardt@tu-dresden.de> Date: Fri, 23 Oct 2015 00:53:21 +0200 Subject: [PATCH] Use std::unique_ptr instead of std::auto_ptr --- dune/solvers/iterationsteps/amgstep.hh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dune/solvers/iterationsteps/amgstep.hh b/dune/solvers/iterationsteps/amgstep.hh index 3318585f..fb077d09 100644 --- a/dune/solvers/iterationsteps/amgstep.hh +++ b/dune/solvers/iterationsteps/amgstep.hh @@ -7,6 +7,8 @@ \brief A wrapper class for the ISTL AMG implementation */ +#include <memory> + #include <dune/solvers/iterationsteps/lineariterationstep.hh> #include <dune/istl/paamg/amg.hh> @@ -43,8 +45,8 @@ public: { setProblem(*stiffnessMatrix, x, rhs); - fop_ = std::auto_ptr<Operator>(new Operator(*stiffnessMatrix)); - amg_ = std::auto_ptr<AMG>(new AMG(*fop_, coarseningCriterion, smootherArgs, 1, 1, 1, false)); + fop_ = std::unique_ptr<Operator>(new Operator(*stiffnessMatrix)); + amg_ = std::unique_ptr<AMG>(new AMG(*fop_, coarseningCriterion, smootherArgs, 1, 1, 1, false)); amg_->pre(*this->x_,*this->rhs_); } @@ -63,7 +65,7 @@ public: { LinearIterationStep<MatrixType, VectorType>::setProblem(stiffnessMatrix, x, rhs); - fop_ = std::auto_ptr<Operator>(new Operator(stiffnessMatrix)); + fop_ = std::unique_ptr<Operator>(new Operator(stiffnessMatrix)); } /** \brief Sets up an algebraic hierarchy @@ -85,16 +87,16 @@ public: private: /** \brief A matrix wrapper demanded by istl */ - std::auto_ptr<Operator> fop_; + std::unique_ptr<Operator> fop_; /** \brief The dune-istl AMG step */ - std::auto_ptr<AMG> amg_; + std::unique_ptr<AMG> amg_; }; template <class MatrixType, class VectorType> void AMGStep<MatrixType,VectorType>::preprocess() { - amg_ = std::auto_ptr<AMG>(new AMG(*fop_, coarseningCriterion_, smootherArgs_, 1, 1, 1, false)); + amg_ = std::unique_ptr<AMG>(new AMG(*fop_, coarseningCriterion_, smootherArgs_, 1, 1, 1, false)); amg_->pre(*this->x_,*this->rhs_); } -- GitLab