ginkgo/core/reorder/mc64.hpp Source File

ginkgo/core/reorder/mc64.hpp Source File#

Reference API: ginkgo/core/reorder/mc64.hpp Source File
Reference API
mc64.hpp
1// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef GKO_PUBLIC_CORE_REORDER_MC64_HPP_
6#define GKO_PUBLIC_CORE_REORDER_MC64_HPP_
7
8
9#include <limits>
10#include <memory>
11
12#include <ginkgo/core/base/abstract_factory.hpp>
13#include <ginkgo/core/base/composition.hpp>
14#include <ginkgo/core/base/dim.hpp>
15#include <ginkgo/core/base/lin_op.hpp>
16#include <ginkgo/core/base/polymorphic_object.hpp>
17#include <ginkgo/core/base/types.hpp>
18#include <ginkgo/core/base/utils.hpp>
19#include <ginkgo/core/matrix/csr.hpp>
20#include <ginkgo/core/matrix/diagonal.hpp>
21#include <ginkgo/core/matrix/identity.hpp>
22#include <ginkgo/core/matrix/permutation.hpp>
23#include <ginkgo/core/matrix/sparsity_csr.hpp>
24#include <ginkgo/core/reorder/reordering_base.hpp>
25
26
27namespace gko {
28namespace experimental {
34namespace reorder {
35
36
44enum class mc64_strategy { max_diagonal_product, max_diagonal_sum };
45
46
76template <typename ValueType = default_precision, typename IndexType = int32>
77class Mc64 final
78 : public EnablePolymorphicObject<Mc64<ValueType, IndexType>, LinOpFactory>,
79 public EnablePolymorphicAssignment<Mc64<ValueType, IndexType>> {
80public:
81 struct parameters_type;
82 friend class EnablePolymorphicObject<Mc64<ValueType, IndexType>,
85 Mc64<ValueType, IndexType>>;
86
87 using value_type = ValueType;
88 using index_type = IndexType;
91
93 : public enable_parameters_type<parameters_type, Mc64> {
98 strategy, mc64_strategy::max_diagonal_product);
99
105 tolerance,
106 50 * std::numeric_limits<remove_complex<ValueType>>::epsilon());
107 };
108
114 const parameters_type& get_parameters() const { return parameters_; }
115
123 std::unique_ptr<result_type> generate(
124 std::shared_ptr<const LinOp> system_matrix) const;
125
127 static parameters_type build() { return {}; }
128
129private:
130 explicit Mc64(std::shared_ptr<const Executor> exec,
131 const parameters_type& params = {});
132
133 std::unique_ptr<LinOp> generate_impl(
134 std::shared_ptr<const LinOp> system_matrix) const override;
135
136 parameters_type parameters_;
137};
138
139
140} // namespace reorder
141} // namespace experimental
142} // namespace gko
143
144
145#endif // GKO_PUBLIC_CORE_REORDER_MC64_HPP_
Definition composition.hpp:41
Definition polymorphic_object.hpp:743
Definition polymorphic_object.hpp:668
Definition lin_op.hpp:385
Definition abstract_factory.hpp:211
Definition mc64.hpp:79
static parameters_type build()
Definition mc64.hpp:127
std::unique_ptr< result_type > generate(std::shared_ptr< const LinOp > system_matrix) const
const parameters_type & get_parameters() const
Definition mc64.hpp:114
Definition csr.hpp:123
#define GKO_FACTORY_PARAMETER_SCALAR(_name, _default)
Definition abstract_factory.hpp:445
mc64_strategy
Definition mc64.hpp:44
The Ginkgo namespace.
Definition abstract_factory.hpp:20
typename detail::remove_complex_s< T >::type remove_complex
Definition math.hpp:260
mc64_strategy strategy
Definition mc64.hpp:98
remove_complex< ValueType > tolerance
Definition mc64.hpp:106