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::matrix::Identity< ValueType > Class Template Reference

This class is a utility which efficiently implements the identity matrix (a linear operator which maps each vector to itself). More...

#include <ginkgo/core/matrix/identity.hpp>

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

Public Types

using value_type = ValueType
using transposed_type = Identity<ValueType>
Public Types inherited from gko::EnablePolymorphicAssignment< Identity< default_precision > >
using result_type

Public Member Functions

std::unique_ptr< LinOptranspose () const override
 Returns a LinOp representing the transpose of the Transposable object.
std::unique_ptr< LinOpconj_transpose () const override
 Returns a LinOp representing the conjugate transpose of the Transposable object.
Public Member Functions inherited from gko::EnableLinOp< Identity< default_precision > >
const Identity< default_precision > * apply (ptr_param< const LinOp > b, ptr_param< LinOp > x) const
Public Member Functions inherited from gko::EnablePolymorphicAssignment< Identity< 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< Identity > create (std::shared_ptr< const Executor > exec, dim< 2 > size)
 Creates an Identity matrix of the specified size.
static std::unique_ptr< Identity > create (std::shared_ptr< const Executor > exec, size_type size=0)
 Creates an Identity matrix of the specified size.

Friends

class EnablePolymorphicObject< Identity, LinOp >

Detailed Description

template<typename ValueType = default_precision>
class gko::matrix::Identity< ValueType >

This class is a utility which efficiently implements the identity matrix (a linear operator which maps each vector to itself).

Thus, objects of the Identity class always represent a square matrix, and don't require any storage for their values. The apply method is implemented as a simple copy (or a linear combination).

Note
This class is useful when composing it with other operators. For example, it can be used instead of a preconditioner in Krylov solvers, if one wants to run a "plain" solver, without using a preconditioner.
Template Parameters
ValueTypeprecision of matrix elements

Member Function Documentation

◆ conj_transpose()

template<typename ValueType = default_precision>
std::unique_ptr< LinOp > gko::matrix::Identity< ValueType >::conj_transpose ( ) const
overridevirtual

Returns a LinOp representing the conjugate transpose of the Transposable object.

Returns
a pointer to the new conjugate transposed object

Implements gko::Transposable.

◆ create() [1/2]

template<typename ValueType = default_precision>
std::unique_ptr< Identity > gko::matrix::Identity< ValueType >::create ( std::shared_ptr< const Executor > exec,
dim< 2 > size )
static

Creates an Identity matrix of the specified size.

Parameters
sizesize of the matrix (must be square)

◆ create() [2/2]

template<typename ValueType = default_precision>
std::unique_ptr< Identity > gko::matrix::Identity< ValueType >::create ( std::shared_ptr< const Executor > exec,
size_type size = 0 )
static

Creates an Identity matrix of the specified size.

Parameters
sizesize of the matrix

◆ transpose()

template<typename ValueType = default_precision>
std::unique_ptr< LinOp > gko::matrix::Identity< ValueType >::transpose ( ) const
overridevirtual

Returns a LinOp representing the transpose of the Transposable object.

Returns
a pointer to the new transposed object

Implements gko::Transposable.


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