EnablePreconditionable< DerivedType > Class Template Reference

EnablePreconditionable&lt; DerivedType &gt; Class Template Reference#

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

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

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

Public Member Functions

void set_preconditioner (std::shared_ptr< const LinOp > new_precond) override
 
EnablePreconditionableoperator= (const EnablePreconditionable &other)
 
EnablePreconditionableoperator= (EnablePreconditionable &&other)
 
 EnablePreconditionable (std::shared_ptr< const LinOp > preconditioner)
 
 EnablePreconditionable (const EnablePreconditionable &other)
 
 EnablePreconditionable (EnablePreconditionable &&other)
 
- Public Member Functions inherited from gko::Preconditionable
virtual std::shared_ptr< const LinOpget_preconditioner () const
 

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() [1/2]

template<typename DerivedType >
gko::solver::EnablePreconditionable< DerivedType >::EnablePreconditionable ( const EnablePreconditionable< DerivedType > &  other)
inline

Creates a shallow copy of the provided preconditioner.

◆ EnablePreconditionable() [2/2]

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=() [1/2]

template<typename DerivedType >
EnablePreconditionable & gko::solver::EnablePreconditionable< DerivedType >::operator= ( const EnablePreconditionable< DerivedType > &  other)
inline

Creates a shallow copy of the provided preconditioner, clones it onto this executor if executors don't match.

References gko::Preconditionable::get_preconditioner(), and gko::solver::EnablePreconditionable< DerivedType >::set_preconditioner().

◆ operator=() [2/2]

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 gko::solver::EnablePreconditionable< DerivedType >::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_precondthe new preconditioner operator used by the Preconditionable

Reimplemented from gko::Preconditionable.

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

Referenced by gko::solver::EnablePreconditionable< DerivedType >::operator=(), and gko::solver::EnablePreconditionable< DerivedType >::operator=().


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