Ginkgo Generated from branch based on main. Ginkgo version 1.9.0
A numerical linear algebra library targeting many-core architectures
 
Loading...
Searching...
No Matches
lin_op.hpp
1// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef GKO_PUBLIC_CORE_DISTRIBUTED_LIN_OP_HPP_
6#define GKO_PUBLIC_CORE_DISTRIBUTED_LIN_OP_HPP_
7
8
9#include <memory>
10#include <type_traits>
11#include <utility>
12
13#include <ginkgo/config.hpp>
14
15
16#if GINKGO_BUILD_MPI
17
18
19#include <ginkgo/core/base/lin_op.hpp>
20#include <ginkgo/core/distributed/polymorphic_object.hpp>
21
22
23namespace gko {
24namespace experimental {
25
26
41template <typename ConcreteLinOp, typename PolymorphicBase = LinOp>
43 : public EnableDistributedPolymorphicObject<ConcreteLinOp, PolymorphicBase>,
44 public EnablePolymorphicAssignment<ConcreteLinOp> {
45public:
47 ConcreteLinOp, PolymorphicBase>::EnableDistributedPolymorphicObject;
48
49 const ConcreteLinOp* apply(ptr_param<const LinOp> b,
50 ptr_param<LinOp> x) const
51 {
52 PolymorphicBase::apply(b, x);
53 return self();
54 }
55
56 ConcreteLinOp* apply(ptr_param<const LinOp> b, ptr_param<LinOp> x)
57 {
58 PolymorphicBase::apply(b, x);
59 return self();
60 }
61
62 const ConcreteLinOp* apply(ptr_param<const LinOp> alpha,
65 ptr_param<LinOp> x) const
66 {
67 PolymorphicBase::apply(alpha, b, beta, x);
68 return self();
69 }
70
71 ConcreteLinOp* apply(ptr_param<const LinOp> alpha, ptr_param<const LinOp> b,
73 {
74 PolymorphicBase::apply(alpha, b, beta, x);
75 return self();
76 }
77
78protected:
79 GKO_ENABLE_SELF(ConcreteLinOp);
80};
81
82
83} // namespace experimental
84} // namespace gko
85
86
87#endif // GINKGO_BUILD_MPI
88#endif // GKO_PUBLIC_CORE_DISTRIBUTED_LIN_OP_HPP_
This mixin is used to enable a default PolymorphicObject::copy_from() implementation for objects that...
Definition polymorphic_object.hpp:723
This mixin does the same as EnableLinOp, but for concrete types that are derived from distributed::Di...
Definition lin_op.hpp:44
This mixin does the same as EnablePolymorphicObject, but for concrete types that are derived from dis...
Definition polymorphic_object.hpp:53
This class is used for function parameters in the place of raw pointers.
Definition utils_helper.hpp:41
The Ginkgo namespace.
Definition abstract_factory.hpp:20