33 #ifndef GKO_CORE_MATRIX_IDENTITY_HPP_ 34 #define GKO_CORE_MATRIX_IDENTITY_HPP_ 37 #include <ginkgo/core/base/lin_op.hpp> 62 template <
typename ValueType = default_precision>
72 using value_type = ValueType;
80 explicit Identity(std::shared_ptr<const Executor> exec)
89 Identity(std::shared_ptr<const Executor> exec,
size_type size)
93 void apply_impl(
const LinOp *b, LinOp *x)
const override;
95 void apply_impl(
const LinOp *alpha,
const LinOp *b,
const LinOp *beta,
96 LinOp *x)
const override;
112 template <
typename ValueType = default_precision>
118 using value_type = ValueType;
127 static std::unique_ptr<IdentityFactory>
create(
128 std::shared_ptr<const Executor> exec)
130 return std::unique_ptr<IdentityFactory>(
131 new IdentityFactory(std::move(exec)));
135 std::unique_ptr<LinOp> generate_impl(
136 std::shared_ptr<const LinOp> base)
const override;
138 IdentityFactory(std::shared_ptr<const Executor> exec)
148 #endif // GKO_CORE_MATRIX_IDENTITY_HPP_
This mixin implements a static create() method on ConcreteType that dynamically allocates the memory...
Definition: polymorphic_object.hpp:576
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition: polymorphic_object.hpp:505
static std::unique_ptr< IdentityFactory > create(std::shared_ptr< const Executor > exec)
Creates a new Identity factory.
Definition: identity.hpp:127
std::size_t size_type
Integral type used for allocation quantities.
Definition: types.hpp:94
The Ginkgo namespace.
Definition: abstract_factory.hpp:45
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition: lin_op.hpp:509
This factory is a utility which can be used to generate Identity operators.
Definition: identity.hpp:113
This class is a utility which efficiently implements the identity matrix (a linear operator which map...
Definition: identity.hpp:63