Ginkgo  Generated from pipelines/1478841010 branch based on develop. Ginkgo version 1.9.0
A numerical linear algebra library targeting many-core architectures
Public Member Functions | List of all members
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. More...
 
EnablePreconditionableoperator= (const EnablePreconditionable &other)
 Creates a shallow copy of the provided preconditioner, clones it onto this executor if executors don't match.
 
EnablePreconditionableoperator= (EnablePreconditionable &&other)
 Moves the provided preconditioner, clones it onto this executor if executors don't match. More...
 
 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. More...
 
- Public Member Functions inherited from gko::Preconditionable
virtual std::shared_ptr< const LinOpget_preconditioner () const
 Returns the preconditioner operator used by the Preconditionable. More...
 

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
DerivedTypeThe 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.

◆ 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_precondthe new preconditioner operator used by the Preconditionable

Reimplemented from gko::Preconditionable.

Referenced by gko::solver::EnablePreconditionable< Bicg< ValueType > >::operator=().


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