Perturbation< ValueType > Class Template Reference#
|
Reference API
|
#include <ginkgo/core/base/perturbation.hpp>
Public Types | |
| using | value_type = ValueType |
Public Types inherited from gko::EnablePolymorphicAssignment< ConcreteLinOp > | |
| using | result_type = ConcreteLinOp |
Public Types inherited from gko::ConvertibleTo< ResultType > | |
| using | result_type = ResultType |
Public Member Functions | |
| const std::shared_ptr< const LinOp > | get_basis () const noexcept |
| const std::shared_ptr< const LinOp > | get_projector () const noexcept |
| const std::shared_ptr< const LinOp > | get_scalar () const noexcept |
| Perturbation & | operator= (const Perturbation &other) |
| Perturbation & | operator= (Perturbation &&other) |
| Perturbation (const Perturbation &other) | |
| Perturbation (Perturbation &&other) | |
Public Member Functions inherited from gko::EnableLinOp< ConcreteLinOp, PolymorphicBase > | |
| const ConcreteLinOp * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) const |
| ConcreteLinOp * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) |
| const ConcreteLinOp * | apply (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b, ptr_param< const LinOp > beta, ptr_param< LinOp > x) const |
| ConcreteLinOp * | apply (ptr_param< const LinOp > alpha, ptr_param< const LinOp > b, ptr_param< const LinOp > beta, ptr_param< LinOp > x) |
Public Member Functions inherited from gko::EnableAbstractPolymorphicObject< AbstractObject, PolymorphicBase > | |
| std::unique_ptr< AbstractObject > | create_default (std::shared_ptr< const Executor > exec) const |
| std::unique_ptr< AbstractObject > | create_default () const |
| std::unique_ptr< AbstractObject > | clone (std::shared_ptr< const Executor > exec) const |
| std::unique_ptr< AbstractObject > | clone () const |
| AbstractObject * | copy_from (const PolymorphicObject *other) |
| template<typename Derived > | |
| std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, AbstractObject > * | copy_from (std::unique_ptr< Derived > &&other) |
| template<typename Derived > | |
| std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, AbstractObject > * | copy_from (const std::unique_ptr< Derived > &other) |
| AbstractObject * | copy_from (const std::shared_ptr< const PolymorphicObject > &other) |
| AbstractObject * | move_from (ptr_param< PolymorphicObject > other) |
| AbstractObject * | 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) |
Public Member Functions inherited from gko::EnablePolymorphicAssignment< ConcreteLinOp > | |
| void | convert_to (result_type *result) const override |
| void | move_to (result_type *result) override |
Public Member Functions inherited from gko::ConvertibleTo< ResultType > | |
| virtual void | convert_to (result_type *result) const =0 |
| void | convert_to (ptr_param< result_type > result) const |
| virtual void | move_to (result_type *result)=0 |
| void | move_to (ptr_param< result_type > result) |
Static Public Member Functions | |
| static std::unique_ptr< Perturbation > | create (std::shared_ptr< const Executor > exec) |
| static std::unique_ptr< Perturbation > | create (std::shared_ptr< const LinOp > scalar, std::shared_ptr< const LinOp > basis) |
| static std::unique_ptr< Perturbation > | create (std::shared_ptr< const LinOp > scalar, std::shared_ptr< const LinOp > basis, std::shared_ptr< const LinOp > projector) |
Static Public Member Functions inherited from gko::EnableCreateMethod< ConcreteType > | |
| template<typename... Args> | |
| static std::unique_ptr< ConcreteType > | create (Args &&... args) |
Protected Member Functions | |
| Perturbation (std::shared_ptr< const Executor > exec) | |
| Perturbation (std::shared_ptr< const LinOp > scalar, std::shared_ptr< const LinOp > basis) | |
| Perturbation (std::shared_ptr< const LinOp > scalar, std::shared_ptr< const LinOp > basis, std::shared_ptr< const LinOp > projector) | |
| void | apply_impl (const LinOp *b, LinOp *x) const override |
| void | apply_impl (const LinOp *alpha, const LinOp *b, const LinOp *beta, LinOp *x) const override |
| void | validate_perturbation () |
Protected Member Functions inherited from gko::EnableLinOp< ConcreteLinOp, PolymorphicBase > | |
| ConcreteLinOp * | self () noexcept |
| const ConcreteLinOp * | self () const noexcept |
Protected Member Functions inherited from gko::EnablePolymorphicObject< ConcreteObject, PolymorphicBase > | |
| std::unique_ptr< PolymorphicObject > | create_default_impl (std::shared_ptr< const Executor > exec) const override |
| PolymorphicObject * | copy_from_impl (const PolymorphicObject *other) override |
| PolymorphicObject * | copy_from_impl (std::unique_ptr< PolymorphicObject > other) override |
| PolymorphicObject * | move_from_impl (PolymorphicObject *other) override |
| PolymorphicObject * | move_from_impl (std::unique_ptr< PolymorphicObject > other) override |
| PolymorphicObject * | clear_impl () override |
Protected Member Functions inherited from gko::PolymorphicObject | |
| PolymorphicObject (std::shared_ptr< const Executor > exec) | |
| PolymorphicObject (const PolymorphicObject &other) | |
Protected Member Functions inherited from gko::log::EnableLogging< PolymorphicObject > | |
| void | log (Params &&... params) const |
Friends | |
| class | EnablePolymorphicObject< Perturbation, LinOp > |
| class | EnableCreateMethod< Perturbation > |
Additional Inherited Members | |
Protected Attributes inherited from gko::log::EnableLogging< PolymorphicObject > | |
| std::vector< std::shared_ptr< const Logger > > | loggers_ |
Detailed Description
class gko::Perturbation< ValueType >
The Perturbation class can be used to construct a LinOp to represent the operation (identity + scalar * basis * projector). This operator adds a movement along a direction constructed by basis and projector on the LinOp. projector gives the coefficient of basis to decide the direction.
For example, the Householder matrix can be represented with the Perturbation operator as follows. If u is the Householder factor then we can generate the Householder transformation, H = (I - 2 u u*). In this case, the parameters of Perturbation class are scalar = -2, basis = u, and projector = u*.
- Template Parameters
-
ValueType precision of input and result vectors
- Note
- the apply operations of Perturbation class are not thread safe
Member Function Documentation
◆ create() [1/3]
|
static |
Creates an empty perturbation operator (0x0 operator).
- Parameters
-
exec Executor associated to the perturbation
- Returns
- A smart pointer to the newly created perturbation.
◆ create() [2/3]
|
static |
Creates a perturbation with scalar and basis by setting projector to the conjugate transpose of basis. Basis must be transposable. Perturbation will throw gko::NotSupported if basis is not transposable.
- Parameters
-
scalar scaling of the movement basis the direction basis
- Returns
- A smart pointer to the newly created perturbation.
◆ create() [3/3]
|
static |
Creates a perturbation of scalar, basis and projector.
- Parameters
-
scalar scaling of the movement basis the direction basis projector decides the coefficient of basis
- Returns
- A smart pointer to the newly created perturbation.
◆ get_basis()
|
inlinenoexcept |
Returns the basis of the perturbation.
- Returns
- the basis of the perturbation
◆ get_projector()
|
inlinenoexcept |
Returns the projector of the perturbation.
- Returns
- the projector of the perturbation
◆ get_scalar()
|
inlinenoexcept |
Returns the scalar of the perturbation.
- Returns
- the scalar of the perturbation
◆ validate_perturbation()
|
protected |
Validates the dimensions of the scalar, basis and projector parameters for the apply. scalar must be 1 by 1. The dimension of basis should be same as the dimension of conjugate transpose of projector.
The documentation for this class was generated from the following file:
- ginkgo/core/base/perturbation.hpp
Generated by
Public Types inherited from