LinOp Class Reference#
|
Reference API
|
Inherits gko::EnableAbstractPolymorphicObject< LinOp >.
Inherited by gko::EnableAbstractPolymorphicObject< StencilMatrix< ValueType >, LinOp >, gko::EnableAbstractPolymorphicObject< BlockOperator, LinOp >, gko::EnableAbstractPolymorphicObject< Combination< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Composition< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< ConcreteLinOp, LinOp >, gko::EnableAbstractPolymorphicObject< Perturbation< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Matrix< default_precision, int32, int64 >, LinOp >, gko::EnableAbstractPolymorphicObject< Vector< double >, LinOp >, gko::EnableAbstractPolymorphicObject< Schwarz< default_precision, int32, int64 >, LinOp >, gko::EnableAbstractPolymorphicObject< Factorization< ValueType, IndexType >, LinOp >, gko::EnableAbstractPolymorphicObject< ScaledReordered< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Direct< ValueType, IndexType >, LinOp >, gko::EnableAbstractPolymorphicObject< Composition< gko::default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Coo< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Csr< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Dense< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Diagonal< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Ell< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Fbcsr< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Fft, LinOp >, gko::EnableAbstractPolymorphicObject< Fft2, LinOp >, gko::EnableAbstractPolymorphicObject< Fft3, LinOp >, gko::EnableAbstractPolymorphicObject< Hybrid< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Identity< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Permutation< int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< RowGatherer< int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< ScaledPermutation< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Sellp< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< SparsityCsr< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< FixedCoarsening< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Pgm< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Ic< solver::LowerTrs<>, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Ilu< solver::LowerTrs<>, solver::UpperTrs<>, false, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Isai< IsaiType, ValueType, IndexType >, LinOp >, gko::EnableAbstractPolymorphicObject< Jacobi< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Bicg< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Bicgstab< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< CbGmres< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Cg< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Cgs< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Fcg< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Gcr< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Gmres< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Idr< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Ir< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< LowerTrs< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Minres< default_precision >, LinOp >, gko::EnableAbstractPolymorphicObject< Multigrid, LinOp >, gko::EnableAbstractPolymorphicObject< UpperTrs< default_precision, int32 >, LinOp >, gko::EnableAbstractPolymorphicObject< Dense< value_type >, LinOp >, and gko::EnableAbstractPolymorphicObject< Dense< ValueType >, LinOp >.
Public Member Functions | |
| LinOp * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) |
| const LinOp * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) const |
| LinOp * | apply (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b, ptr_param< const LinOp > beta, ptr_param< LinOp > x) |
| const LinOp * | apply (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b, ptr_param< const LinOp > beta, ptr_param< LinOp > x) const |
| const dim< 2 > & | get_size () const noexcept |
| virtual bool | apply_uses_initial_guess () const |
| LinOp & | operator= (const LinOp &)=default |
| LinOp & | operator= (LinOp &&other) |
| LinOp (const LinOp &)=default | |
| LinOp (LinOp &&other) | |
Public Member Functions inherited from gko::EnableAbstractPolymorphicObject< LinOp > | |
| std::unique_ptr< LinOp > | create_default (std::shared_ptr< const Executor > exec) const |
| std::unique_ptr< LinOp > | create_default () const |
| std::unique_ptr< LinOp > | clone (std::shared_ptr< const Executor > exec) const |
| std::unique_ptr< LinOp > | clone () const |
| LinOp * | copy_from (const PolymorphicObject *other) |
| std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, LinOp > * | copy_from (std::unique_ptr< Derived > &&other) |
| std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, LinOp > * | copy_from (const std::unique_ptr< Derived > &other) |
| LinOp * | copy_from (const std::shared_ptr< const PolymorphicObject > &other) |
| LinOp * | move_from (ptr_param< PolymorphicObject > other) |
| LinOp * | clear () |
Public Member Functions inherited from gko::PolymorphicObject | |
| PolymorphicObject & | operator= (const PolymorphicObject &) |
| std::unique_ptr< PolymorphicObject > | create_default (std::shared_ptr< const Executor > exec) const |
| std::unique_ptr< PolymorphicObject > | create_default () const |
| std::unique_ptr< PolymorphicObject > | clone (std::shared_ptr< const Executor > exec) const |
| std::unique_ptr< PolymorphicObject > | clone () const |
| PolymorphicObject * | copy_from (const PolymorphicObject *other) |
| template<typename Derived , typename Deleter > | |
| std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, PolymorphicObject > * | copy_from (std::unique_ptr< Derived, Deleter > &&other) |
| template<typename Derived , typename Deleter > | |
| std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, PolymorphicObject > * | copy_from (const std::unique_ptr< Derived, Deleter > &other) |
| PolymorphicObject * | copy_from (const std::shared_ptr< const PolymorphicObject > &other) |
| PolymorphicObject * | move_from (ptr_param< PolymorphicObject > other) |
| PolymorphicObject * | clear () |
| std::shared_ptr< const Executor > | get_executor () const noexcept |
Public Member Functions inherited from gko::log::EnableLogging< PolymorphicObject > | |
| void | add_logger (std::shared_ptr< const Logger > logger) override |
| void | remove_logger (const Logger *logger) override |
| void | remove_logger (ptr_param< const Logger > logger) |
| const std::vector< std::shared_ptr< const Logger > > & | get_loggers () const override |
| void | clear_loggers () override |
Public Member Functions inherited from gko::log::Loggable | |
| void | remove_logger (ptr_param< const Logger > logger) |
Protected Member Functions | |
| LinOp (std::shared_ptr< const Executor > exec, const dim< 2 > &size=dim< 2 >{}) | |
| void | set_size (const dim< 2 > &value) noexcept |
| virtual void | apply_impl (const LinOp *b, LinOp *x) const =0 |
| virtual void | apply_impl (const LinOp *alpha, const LinOp *b, const LinOp *beta, LinOp *x) const =0 |
| void | validate_application_parameters (const LinOp *b, const LinOp *x) const |
| void | validate_application_parameters (const LinOp *alpha, const LinOp *b, const LinOp *beta, const LinOp *x) const |
Protected Member Functions inherited from gko::PolymorphicObject | |
| PolymorphicObject (std::shared_ptr< const Executor > exec) | |
| PolymorphicObject (const PolymorphicObject &other) | |
| virtual std::unique_ptr< PolymorphicObject > | create_default_impl (std::shared_ptr< const Executor > exec) const =0 |
| virtual PolymorphicObject * | copy_from_impl (const PolymorphicObject *other)=0 |
| virtual PolymorphicObject * | copy_from_impl (std::unique_ptr< PolymorphicObject > other)=0 |
| virtual PolymorphicObject * | move_from_impl (PolymorphicObject *other)=0 |
| virtual PolymorphicObject * | move_from_impl (std::unique_ptr< PolymorphicObject > other)=0 |
| virtual PolymorphicObject * | clear_impl ()=0 |
Protected Member Functions inherited from gko::log::EnableLogging< PolymorphicObject > | |
| void | log (Params &&... params) const |
Additional Inherited Members | |
Protected Attributes inherited from gko::log::EnableLogging< PolymorphicObject > | |
| std::vector< std::shared_ptr< const Logger > > | loggers_ |
Constructor & Destructor Documentation
◆ LinOp() [1/3]
|
default |
Copy-constructs a LinOp. Inherits executor and size from the input.
◆ LinOp() [2/3]
|
inline |
Move-constructs a LinOp. Inherits executor and size from the input, which will have size 0x0 and unchanged executor afterwards.
◆ LinOp() [3/3]
|
inlineexplicitprotected |
Creates a linear operator.
- Parameters
-
exec the executor where all the operations are performed size the size of the operator
Member Function Documentation
◆ apply() [1/4]
|
inline |
Performs the operation x = alpha * op(b) + beta * x.
- Parameters
-
alpha scaling of the result of op(b) b vector(s) on which the operator is applied beta scaling of the input x x output vector(s)
- Returns
- this
References apply_impl(), gko::ptr_param< T >::get(), gko::PolymorphicObject::get_executor(), gko::make_temporary_clone(), and validate_application_parameters().
◆ apply() [2/4]
◆ apply() [3/4]
Applies a linear operator to a vector (or a sequence of vectors).
Performs the operation x = op(b), where op is this linear operator.
- Parameters
-
b the input vector(s) on which the operator is applied x the output vector(s) where the result is stored
- Returns
- this
References apply_impl(), gko::ptr_param< T >::get(), gko::PolymorphicObject::get_executor(), gko::make_temporary_clone(), and validate_application_parameters().
◆ apply() [4/4]
◆ apply_impl() [1/2]
|
protectedpure virtual |
Implementers of LinOp should override this function instead of apply(const LinOp *, const LinOp *, const LinOp *, LinOp *).
- Parameters
-
alpha scaling of the result of op(b) b vector(s) on which the operator is applied beta scaling of the input x x output vector(s)
◆ apply_impl() [2/2]
Implementers of LinOp should override this function instead of apply(const LinOp *, LinOp *).
Performs the operation x = op(b), where op is this linear operator.
- Parameters
-
b the input vector(s) on which the operator is applied x the output vector(s) where the result is stored
◆ apply_uses_initial_guess()
|
inlinevirtual |
Returns true if the linear operator uses the data given in x as an initial guess. Returns false otherwise.
- Returns
- true if the linear operator uses the data given in x as an initial guess. Returns false otherwise.
◆ get_size()
|
inlinenoexcept |
Returns the size of the operator.
- Returns
- size of the operator
Referenced by gko::experimental::reorder::ScaledReordered< ValueType, IndexType >::set_cache_to().
◆ operator=() [1/2]
Copy-assigns a LinOp. Preserves the executor and copies the size.
◆ operator=() [2/2]
Move-assigns a LinOp. Preserves the executor and moves the size. The moved-from object has size 0x0 afterwards, but its executor is unchanged.
References set_size().
◆ set_size()
|
inlineprotectednoexcept |
Sets the size of the operator.
- Parameters
-
value the new size of the operator
Referenced by operator=().
◆ validate_application_parameters() [1/2]
|
inlineprotected |
Throws a DimensionMismatch exception if the parameters to apply are of the wrong size.
- Parameters
-
alpha scaling of the result of op(b) b vector(s) on which the operator is applied beta scaling of the input x x output vector(s)
◆ validate_application_parameters() [2/2]
|
inlineprotected |
Throws a DimensionMismatch exception if the parameters to apply are of the wrong size.
- Parameters
-
b vector(s) on which the operator is applied x output vector(s)
The documentation for this class was generated from the following file:
- ginkgo/core/base/lin_op.hpp
Generated by
Public Member Functions inherited from