Skip to content
Snippets Groups Projects
Commit 13c36c3d authored by Christian Engwer's avatar Christian Engwer
Browse files

[factory] update new constructors to take objects only as shared_ptr

parent 2d108d35
No related branches found
No related tags found
No related merge requests found
......@@ -267,14 +267,14 @@ namespace Dune
DUNE_THROW(InvalidSolverCategory, "LinearOperator and ScalarProduct must have the same SolverCategory!");
}
IterativeSolver (LinearOperator<X,Y>& op, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
_op(stackobject_to_shared_ptr(op)),
_prec(stackobject_to_shared_ptr(prec)),
IterativeSolver (std::shared_ptr<LinearOperator<X,Y> > op, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
_op(op),
_prec(prec),
_sp(new SeqScalarProduct<X>),
_reduction(configuration.get<real_type>("reduction")),
_maxit(configuration.get<int>("maxit")),
_verbose(configuration.get<int>("verbose")),
_category(SolverCategory::category(*_op))
_category(SolverCategory::category(*op))
{
if(SolverCategory::category(*op) != SolverCategory::sequential)
DUNE_THROW(InvalidSolverCategory, "LinearOperator has to be sequential!");
......@@ -282,8 +282,8 @@ namespace Dune
DUNE_THROW(InvalidSolverCategory, "Preconditioner has to be sequential!");
}
IterativeSolver (LinearOperator<X,Y>& op, ScalarProduct<X>& sp, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
_op(stackobject_to_shared_ptr(op)),
IterativeSolver (std::shared_ptr<LinearOperator<X,Y> > op, std::shared_ptr<ScalarProduct<X> > sp, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
_op(op),
_prec(prec),
_sp(sp),
_reduction(configuration.get<real_type>("reduction")),
......
......@@ -1060,12 +1060,12 @@ namespace Dune {
_restart(restart)
{}
RestartedGMResSolver (LinearOperator<X,Y>& op, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
RestartedGMResSolver (std::shared_ptr<LinearOperator<X,Y> > op, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
IterativeSolver<X,Y>::IterativeSolver(op,prec,configuration),
_restart(configuration.get<int>("restart"))
{}
RestartedGMResSolver (LinearOperator<X,Y>& op, ScalarProduct<X>& sp, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
RestartedGMResSolver (std::shared_ptr<LinearOperator<X,Y> > op, std::shared_ptr<ScalarProduct<X> > sp, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
IterativeSolver<X,Y>::IterativeSolver(op,sp,prec,configuration),
_restart(configuration.get<int>("restart"))
{}
......@@ -1388,13 +1388,13 @@ namespace Dune {
{}
GeneralizedPCGSolver (LinearOperator<X,Y>& op, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
IterativeSolver<X,Y>::IterativeSolver(op,prec,configuration),
GeneralizedPCGSolver (std::shared_ptr<LinearOperator<X,X> > op, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
IterativeSolver<X,X>::IterativeSolver(op,prec,configuration),
_restart(configuration.get<int>("restart"))
{}
GeneralizedPCGSolver (LinearOperator<X,Y>& op, ScalarProduct<X>& sp, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
IterativeSolver<X,Y>::IterativeSolver(op,sp,prec,configuration),
GeneralizedPCGSolver (std::shared_ptr<LinearOperator<X,X> > op, std::shared_ptr<ScalarProduct<X> > sp, std::shared_ptr<Preconditioner<X,X> > prec, const ParameterTree& configuration) :
IterativeSolver<X,X>::IterativeSolver(op,sp,prec,configuration),
_restart(configuration.get<int>("restart"))
{}
/*!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment