33#ifndef GKO_PUBLIC_CORE_MATRIX_IDENTITY_HPP_
34#define GKO_PUBLIC_CORE_MATRIX_IDENTITY_HPP_
37#include <ginkgo/core/base/lin_op.hpp>
62template <
typename ValueType = default_precision>
73 using value_type = ValueType;
87 explicit Identity(std::shared_ptr<const Executor> exec)
99 GKO_ASSERT_IS_SQUARE_MATRIX(
this);
107 Identity(std::shared_ptr<const Executor> exec,
size_type size)
111 void apply_impl(
const LinOp* b, LinOp* x)
const override;
113 void apply_impl(
const LinOp* alpha,
const LinOp* b,
const LinOp* beta,
114 LinOp* x)
const override;
130template <
typename ValueType = default_precision>
136 using value_type = ValueType;
145 static std::unique_ptr<IdentityFactory>
create(
146 std::shared_ptr<const Executor> exec)
148 return std::unique_ptr<IdentityFactory>(
153 std::unique_ptr<LinOp> generate_impl(
154 std::shared_ptr<const LinOp>
base)
const override;
This mixin implements a static create() method on ConcreteType that dynamically allocates the memory,...
Definition polymorphic_object.hpp:776
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition lin_op.hpp:908
void move_to(result_type *result) override
Definition polymorphic_object.hpp:760
void convert_to(result_type *result) const override
Definition polymorphic_object.hpp:758
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition polymorphic_object.hpp:691
A LinOpFactory represents a higher order mapping which transforms one linear operator into another.
Definition lin_op.hpp:414
Definition lin_op.hpp:146
Linear operators which support transposition should implement the Transposable interface.
Definition lin_op.hpp:462
This factory is a utility which can be used to generate Identity operators.
Definition identity.hpp:132
static std::unique_ptr< IdentityFactory > create(std::shared_ptr< const Executor > exec)
Creates a new Identity factory.
Definition identity.hpp:145
This class is a utility which efficiently implements the identity matrix (a linear operator which map...
Definition identity.hpp:65
std::unique_ptr< LinOp > conj_transpose() const override
Returns a LinOp representing the conjugate transpose of the Transposable object.
std::unique_ptr< LinOp > transpose() const override
Returns a LinOp representing the transpose of the Transposable object.
The Ginkgo namespace.
Definition abstract_factory.hpp:48
constexpr T one()
Returns the multiplicative identity for T.
Definition math.hpp:803
std::size_t size_type
Integral type used for allocation quantities.
Definition types.hpp:120
A type representing the dimensions of a multidimensional object.
Definition dim.hpp:55