Skip to content
Snippets Groups Projects
Commit aff51273 authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

Use std::unique_ptr instead of std::auto_ptr

parent f2334447
No related branches found
No related tags found
No related merge requests found
......@@ -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_);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment