Ginkgo: gko::Perturbation< ValueType > 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::Perturbation< ValueType > Class Template Reference
Linear Operators

The Perturbation class can be used to construct a LinOp to represent the operation (identity + scalar * basis * projector). More...

`#include <ginkgo/core/base/perturbation.hpp>`

Inheritance diagram for gko::Perturbation< ValueType >:
[legend]
Collaboration diagram for gko::Perturbation< ValueType >:
[legend]

## Public Types
using | value_type = ValueType
Public Types inherited from gko::EnablePolymorphicAssignment< Perturbation< default_precision > >
using | result_type

## Public Member Functions
const std::shared_ptr< const LinOp > | get_basis () const noexcept
| Returns the basis of the perturbation.
const std::shared_ptr< const LinOp > | get_projector () const noexcept
| Returns the projector of the perturbation.
const std::shared_ptr< const LinOp > | get_scalar () const noexcept
| Returns the scalar of the perturbation.
Perturbation & | operator= (const Perturbation &other)
Perturbation & | operator= (Perturbation &&other)
| Perturbation (const Perturbation &other)
| Perturbation (Perturbation &&other)
Public Member Functions inherited from gko::EnableLinOp< Perturbation< default_precision > >
const Perturbation< default_precision > * | apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) const
Public Member Functions inherited from gko::EnablePolymorphicAssignment< Perturbation< default_precision > >
void | convert_to (result_type *result) const override
void | move_to (result_type *result) override

## Static Public Member Functions
static std::unique_ptr< Perturbation > | create (std::shared_ptr< const Executor > exec)
| Creates an empty perturbation operator (0x0 operator).
static std::unique_ptr< Perturbation > | create (std::shared_ptr< const LinOp > scalar, std::shared_ptr< const LinOp > basis)
| Creates a perturbation with scalar and basis by setting projector to the conjugate transpose of 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)
| Creates a perturbation of scalar, basis and projector.
Static Public Member Functions inherited from gko::EnableCreateMethod< Perturbation< default_precision > >
static std::unique_ptr< Perturbation< default_precision > > | create (Args &&... args)

## Friends
class | EnablePolymorphicObject< Perturbation, LinOp >
class | EnableCreateMethod< Perturbation >

## Detailed Description

template<typename ValueType = default_precision>
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]

template<typename ValueType = default_precision>

std::unique_ptr< Perturbation > gko::Perturbation< ValueType >::create | ( | std::shared_ptr< const Executor > | exec | ) |
| 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]

template<typename ValueType = default_precision>

std::unique_ptr< Perturbation > gko::Perturbation< ValueType >::create | ( | std::shared_ptr< const LinOp > | scalar,
|  | std::shared_ptr< const LinOp > | basis )
| 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]

template<typename ValueType = default_precision>

std::unique_ptr< Perturbation > gko::Perturbation< ValueType >::create | ( | std::shared_ptr< const LinOp > | scalar,
|  | std::shared_ptr< const LinOp > | basis,
|  | std::shared_ptr< const LinOp > | projector )
| 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()

template<typename ValueType = default_precision>

const std::shared_ptr< const LinOp > gko::Perturbation< ValueType >::get_basis | ( |  | ) | const
| inlinenoexcept

Returns the basis of the perturbation.

Returns
  the basis of the perturbation

## ◆ get_projector()

template<typename ValueType = default_precision>

const std::shared_ptr< const LinOp > gko::Perturbation< ValueType >::get_projector | ( |  | ) | const
| inlinenoexcept

Returns the projector of the perturbation.

Returns
  the projector of the perturbation

## ◆ get_scalar()

template<typename ValueType = default_precision>

const std::shared_ptr< const LinOp > gko::Perturbation< ValueType >::get_scalar | ( |  | ) | const
| inlinenoexcept

Returns the scalar of the perturbation.

Returns
  the scalar of the perturbation

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

- ginkgo/core/base/perturbation.hpp