 |
Ginkgo
Generated from pipelines/2662685947 branch based on develop. Ginkgo version 2.0.0
A numerical linear algebra library targeting many-core architectures
|
5 #ifndef GKO_PUBLIC_CORE_REORDER_RCM_HPP_
6 #define GKO_PUBLIC_CORE_REORDER_RCM_HPP_
11 #include <ginkgo/core/base/abstract_factory.hpp>
12 #include <ginkgo/core/base/array.hpp>
13 #include <ginkgo/core/base/dim.hpp>
14 #include <ginkgo/core/base/lin_op.hpp>
15 #include <ginkgo/core/base/polymorphic_object.hpp>
16 #include <ginkgo/core/base/types.hpp>
17 #include <ginkgo/core/base/utils.hpp>
18 #include <ginkgo/core/matrix/csr.hpp>
19 #include <ginkgo/core/matrix/identity.hpp>
20 #include <ginkgo/core/matrix/permutation.hpp>
21 #include <ginkgo/core/matrix/sparsity_csr.hpp>
22 #include <ginkgo/core/reorder/reordering_base.hpp>
34 enum class starting_strategy { minimum_degree, pseudo_peripheral };
70 template <
typename ValueType = default_precision,
typename IndexType =
int32>
72 GKO_ASSERT_SUPPORTED_VALUE_AND_INDEX_TYPE;
77 using value_type = ValueType;
78 using index_type = IndexType;
99 return inv_permutation_;
120 strategy, starting_strategy::pseudo_peripheral);
122 GKO_ENABLE_REORDERING_BASE_FACTORY(
Rcm, parameters,
Factory);
126 explicit Rcm(std::shared_ptr<const Executor> exec);
131 std::shared_ptr<PermutationMatrix> permutation_;
132 std::shared_ptr<PermutationMatrix> inv_permutation_;
139 namespace experimental {
143 using rcm_starting_strategy = gko::reorder::starting_strategy;
171 template <
typename IndexType =
int32>
173 GKO_ASSERT_SUPPORTED_INDEX_TYPE;
179 using index_type = IndexType;
195 strategy, rcm_starting_strategy::pseudo_peripheral);
212 std::unique_ptr<permutation_type>
generate(
213 std::shared_ptr<const LinOp> system_matrix)
const;
219 explicit Rcm(std::shared_ptr<const Executor> exec,
220 const parameters_type& params = {});
222 std::unique_ptr<LinOp> generate_impl(
223 std::shared_ptr<const LinOp> system_matrix)
const override;
225 parameters_type parameters_;
234 #endif // GKO_PUBLIC_CORE_REORDER_RCM_HPP_
rcm_starting_strategy strategy
This parameter controls the strategy used to determine a starting vertex.
Definition: rcm.hpp:195
bool skip_symmetrize
If set to false, computes the RCM reordering on A + A^T, otherwise assumes that A is symmetric and us...
Definition: rcm.hpp:188
SparsityCsr is a matrix format which stores only the sparsity pattern of a sparse matrix by compressi...
Definition: csr.hpp:40
Rcm (Reverse Cuthill-McKee) is a reordering algorithm minimizing the bandwidth of a matrix.
Definition: rcm.hpp:172
std::unique_ptr< permutation_type > generate(std::shared_ptr< const LinOp > system_matrix) const
Permutation is a matrix format that represents a permutation matrix, i.e.
Definition: csr.hpp:52
#define GKO_FACTORY_PARAMETER_SCALAR(_name, _default)
Creates a scalar factory parameter in the factory parameters structure.
Definition: abstract_factory.hpp:437
The Ginkgo namespace.
Definition: abstract_factory.hpp:20
std::shared_ptr< const PermutationMatrix > get_inverse_permutation() const
Gets the inverse permutation (permutation matrix, output of the algorithm) of the linear operator.
Definition: rcm.hpp:97
const parameters_type & get_parameters()
Returns the parameters used to construct the factory.
Definition: rcm.hpp:203
std::shared_ptr< const PermutationMatrix > get_permutation() const
Gets the permutation (permutation matrix, output of the algorithm) of the linear operator.
Definition: rcm.hpp:86
The ReorderingBase class is a base class for all the reordering algorithms.
Definition: reordering_base.hpp:34
#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:386
#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:272
A LinOpFactory represents a higher order mapping which transforms one linear operator into another.
Definition: lin_op.hpp:343
This struct is used to pass parameters to the EnableDefaultReorderingBaseFactory::generate() method.
Definition: reordering_base.hpp:63
The enable_parameters_type mixin is used to create a base implementation of the factory parameters st...
Definition: abstract_factory.hpp:203
Rcm (Reverse Cuthill-McKee) is a reordering algorithm minimizing the bandwidth of a matrix.
Definition: rcm.hpp:71
static parameters_type build()
Creates a new parameter_type to set up the factory.
Definition: rcm.hpp:216