Ginkgo: gko::solver::EnablePreconditionable< DerivedType > Class Template Reference

| Ginkgo Generated from branch based on main. Ginkgo version 1.11.0 A numerical linear algebra library targeting many-core architectures

Loading...
Searching...
No Matches
gko::solver::EnablePreconditionable< DerivedType > Class Template Reference

Mixin providing default operation for Preconditionable with correct value semantics. More...

`#include <ginkgo/core/solver/solver_base.hpp>`

Inheritance diagram for gko::solver::EnablePreconditionable< DerivedType >:
[legend]
Collaboration diagram for gko::solver::EnablePreconditionable< DerivedType >:
[legend]

## Public Member Functions
void | set_preconditioner (std::shared_ptr< const LinOp > new_precond) override
| Sets the preconditioner operator used by the Preconditionable.
EnablePreconditionable & | operator= (const EnablePreconditionable &other)
| Creates a shallow copy of the provided preconditioner, clones it onto this executor if executors don't match.
EnablePreconditionable & | operator= (EnablePreconditionable &&other)
| Moves the provided preconditioner, clones it onto this executor if executors don't match.
| EnablePreconditionable (std::shared_ptr< const LinOp > preconditioner)
| EnablePreconditionable (const EnablePreconditionable &other)
| Creates a shallow copy of the provided preconditioner.
| EnablePreconditionable (EnablePreconditionable &&other)
| Moves the provided preconditioner.
Public Member Functions inherited from gko::Preconditionable
virtual std::shared_ptr< const LinOp > | get_preconditioner () const
| Returns the preconditioner operator used by the Preconditionable.

## Detailed Description

template<typename DerivedType>
class gko::solver::EnablePreconditionable< DerivedType >

Mixin providing default operation for Preconditionable with correct value semantics.

It ensures that the preconditioner stored in this class will always have the same executor as the object this mixin is used in, creating a clone on the correct executor if necessary.

Template Parameters

  DerivedType | The type that this Mixin is used in. It must provide get_size() and get_executor() functions that return correctly initialized values when the EnablePreconditionable constructor is called, i.e. the constructor must be provided by a base class added before EnablePreconditionable, since the member initialization order also applying to multiple inheritance.

## Constructor & Destructor Documentation

## ◆ EnablePreconditionable()

template<typename DerivedType>

gko::solver::EnablePreconditionable< DerivedType >::EnablePreconditionable | ( | EnablePreconditionable< DerivedType > && | other | ) |
| inline

Moves the provided preconditioner.

The moved-from object has a nullptr preconditioner.

## Member Function Documentation

## ◆ operator=()

template<typename DerivedType>

EnablePreconditionable & gko::solver::EnablePreconditionable< DerivedType >::operator= | ( | EnablePreconditionable< DerivedType > && | other | ) |
| inline

Moves the provided preconditioner, clones it onto this executor if executors don't match.

The moved-from object has a nullptr preconditioner.

References set_preconditioner().

## ◆ set_preconditioner()

template<typename DerivedType>

void gko::solver::EnablePreconditionable< DerivedType >::set_preconditioner | ( | std::shared_ptr< const LinOp > | new_precond | ) |
| inlineoverridevirtual

Sets the preconditioner operator used by the Preconditionable.

Parameters

  new_precond | the new preconditioner operator used by the Preconditionable

Reimplemented from gko::Preconditionable.

References gko::clone(), and gko::Preconditionable::set_preconditioner().

Referenced by operator=(), and operator=().

The documentation for this class was generated from the following file:

- ginkgo/core/solver/solver_base.hpp