 |
Ginkgo
Generated from pipelines/2969282958 branch based on develop. Ginkgo version 2.0.0
A numerical linear algebra library targeting many-core architectures
|
5 #ifndef GKO_PUBLIC_CORE_PRECONDITIONER_NULLSPACE_PROJECTION_HPP_
6 #define GKO_PUBLIC_CORE_PRECONDITIONER_NULLSPACE_PROJECTION_HPP_
11 #include <ginkgo/core/base/abstract_factory.hpp>
12 #include <ginkgo/core/base/lin_op.hpp>
13 #include <ginkgo/core/base/polymorphic_object.hpp>
14 #include <ginkgo/core/config/property_tree.hpp>
15 #include <ginkgo/core/config/registry.hpp>
16 #include <ginkgo/core/config/type_descriptor.hpp>
17 #include <ginkgo/core/solver/nullspace.hpp>
21 namespace preconditioner {
49 template <
typename ValueType = default_precision>
55 GKO_ASSERT_SUPPORTED_VALUE_TYPE;
61 using value_type = ValueType;
70 std::shared_ptr<const solver::Nullspace<ValueType>>
get_nullspace()
const;
79 std::unique_ptr<LinOp>
transpose()
const override;
96 std::shared_ptr<const LinOpFactory> GKO_DEFERRED_FACTORY_PARAMETER(
104 generated_preconditioner,
nullptr);
120 left_nullspace,
nullptr);
141 config::make_type_descriptor<ValueType>());
147 std::shared_ptr<const LinOp> system_matrix);
150 std::shared_ptr<const Executor> exec,
dim<2> size,
151 std::shared_ptr<const LinOp> preconditioner,
155 void apply_impl(
const LinOp* b,
LinOp* x)
const override;
158 LinOp* x)
const override;
163 struct vector_cache {
164 vector_cache() =
default;
165 vector_cache(
const vector_cache&) {}
166 vector_cache(vector_cache&&) noexcept {}
167 vector_cache& operator=(
const vector_cache&) {
return *
this; }
168 vector_cache& operator=(vector_cache&&) noexcept {
return *
this; }
170 mutable std::unique_ptr<LinOp> vec;
173 std::shared_ptr<const LinOp> preconditioner_;
174 std::shared_ptr<const solver::Nullspace<ValueType>> nullspace_;
175 std::shared_ptr<const solver::Nullspace<ValueType>> left_nullspace_;
176 vector_cache projected_input_;
177 vector_cache result_;
185 #endif // GKO_PUBLIC_CORE_PRECONDITIONER_NULLSPACE_PROJECTION_HPP_
pnode describes a tree of properties.
Definition: property_tree.hpp:28
Definition: lin_op.hpp:117
std::shared_ptr< const solver::Nullspace< ValueType > > get_left_nullspace() const
Linear operators which support transposition should implement the Transposable interface.
Definition: lin_op.hpp:492
Definition: nullspace_projection.hpp:122
Nullspace represents the (right or left) nullspace of an operator and is the orthogonal projector on...
Definition: nullspace.hpp:59
std::unique_ptr< LinOp > transpose() const override
Returns a LinOp representing the transpose of the Transposable object.
#define GKO_FACTORY_PARAMETER_SCALAR(_name, _default)
Creates a scalar factory parameter in the factory parameters structure.
Definition: abstract_factory.hpp:469
This class describes the value and index types to be used when building a Ginkgo type from a configur...
Definition: type_descriptor.hpp:39
The Ginkgo namespace.
Definition: abstract_factory.hpp:19
std::unique_ptr< LinOp > conj_transpose() const override
Returns a LinOp representing the conjugate transpose of the Transposable object.
#define GKO_ENABLE_LIN_OP_FACTORY(_lin_op, _parameters_name, _factory_name)
This macro will generate a default implementation of a LinOpFactory for the LinOp subclass it is defi...
Definition: lin_op.hpp:1094
std::shared_ptr< const solver::Nullspace< ValueType > > get_nullspace() const
static parameters_type parse(const config::pnode &config, const config::registry &context, const config::type_descriptor &td_for_child=config::make_type_descriptor< ValueType >())
Create the parameters from the property_tree.
std::shared_ptr< const LinOp > get_preconditioner() const
This mixin is used to enable a default Cloneable::clone() implementation and similar for objects that...
Definition: polymorphic_object.hpp:376
NullspaceProjection wraps a preconditioner with projections onto the complement of a nullspace,...
Definition: nullspace_projection.hpp:50
This class stores additional context for creating Ginkgo objects from configuration files.
Definition: registry.hpp:167
#define GKO_ENABLE_BUILD_METHOD(_factory_name)
Defines a build method for the factory, simplifying its construction by removing the repetitive typin...
Definition: abstract_factory.hpp:418
#define GKO_CREATE_FACTORY_PARAMETERS(_parameters_name, _factory_name)
This Macro will generate a new type containing the parameters for the factory _factory_name.
Definition: abstract_factory.hpp:304