5 #ifndef GKO_PUBLIC_CORE_REORDER_NESTED_DISSECTION_HPP_
6 #define GKO_PUBLIC_CORE_REORDER_NESTED_DISSECTION_HPP_
9 #include <ginkgo/config.hpp>
16 #include <unordered_map>
18 #include <ginkgo/core/base/abstract_factory.hpp>
19 #include <ginkgo/core/base/array.hpp>
20 #include <ginkgo/core/base/dim.hpp>
21 #include <ginkgo/core/base/lin_op.hpp>
22 #include <ginkgo/core/base/polymorphic_object.hpp>
23 #include <ginkgo/core/base/types.hpp>
24 #include <ginkgo/core/matrix/csr.hpp>
25 #include <ginkgo/core/matrix/permutation.hpp>
29 namespace experimental {
46 template <
typename ValueType,
typename IndexType>
47 class NestedDissection
48 :
public EnablePolymorphicObject<NestedDissection<ValueType, IndexType>,
50 public EnablePolymorphicAssignment<
51 NestedDissection<ValueType, IndexType>> {
53 struct parameters_type;
54 friend class EnablePolymorphicObject<NestedDissection<ValueType, IndexType>,
56 friend class enable_parameters_type<parameters_type,
57 NestedDissection<ValueType, IndexType>>;
59 using value_type = ValueType;
60 using index_type = IndexType;
61 using matrix_type = matrix::Csr<value_type, index_type>;
62 using permutation_type = matrix::Permutation<index_type>;
64 struct parameters_type
65 :
public enable_parameters_type<
66 parameters_type, NestedDissection<ValueType, IndexType>> {
71 std::unordered_map<int, int> options;
77 parameters_type& with_options(std::unordered_map<int, int> options)
79 this->options = std::move(options);
89 const parameters_type& get_parameters() {
return parameters_; }
98 std::unique_ptr<permutation_type> generate(
99 std::shared_ptr<const LinOp> system_matrix)
const;
102 static parameters_type build() {
return {}; }
105 explicit NestedDissection(std::shared_ptr<const Executor> exec,
106 const parameters_type& params = {});
108 std::unique_ptr<LinOp> generate_impl(
109 std::shared_ptr<const LinOp> system_matrix)
const override;
112 parameters_type parameters_;
121 #endif // GKO_HAVE_METIS
124 #endif // GKO_PUBLIC_CORE_REORDER_NESTED_DISSECTION_HPP_