3#include <amdis/linearalgebra/mtl/PreconditionerInterface.hpp>
12 template <
class M,
class X,
class Y,
template <
class>
class PreconImpl>
18 using Precon = PreconImpl<M>;
26 return std::make_unique<Self>();
32 void init(M
const& A)
override
34 precon_ = std::make_shared<Precon>(A);
44 void solve(X
const& x, Y& y)
const override
46 test_exit_dbg(
bool(precon_),
"No preconditioner initialized!");
53 test_exit_dbg(
bool(precon_),
"No preconditioner initialized!");
54 precon_->adjoint_solve(x, y);
58 std::shared_ptr<Precon> precon_;
Interface for creators with name.
Definition: CreatorInterface.hpp:44
Interface for Preconditioner y = M*x.
Definition: PreconditionerInterface.hpp:10
Wrapper for using ITL preconditioners in AMDiS.
Definition: Preconditioner.hpp:15
void init(M const &A) override
Implementation of PreconditionerInterface::init()
Definition: Preconditioner.hpp:32
void finish() override
Implementation of PreconditionerInterface::finish()
Definition: Preconditioner.hpp:38
void adjoint_solve(X const &x, Y &y) const override
Implementation of PreconditionerInterface::adjointSolve()
Definition: Preconditioner.hpp:51
void solve(X const &x, Y &y) const override
Implementation of PreconditionerInterface::solve()
Definition: Preconditioner.hpp:44
A creator to be used instead of the constructor.
Definition: Preconditioner.hpp:23
std::unique_ptr< Super > createWithString(std::string) override
Must be implemented by sub classes of CreatorInterfaceName. Creates a new instance of the sub class o...
Definition: Preconditioner.hpp:24