|
27 | 27 |
|
28 | 28 | #pragma once |
29 | 29 |
|
| 30 | +#include <memory> |
| 31 | + |
30 | 32 | #include <tbb/concurrent_vector.h> |
31 | 33 |
|
32 | 34 | #include "WHFC/algorithm/hyperflowcutter.h" |
@@ -57,14 +59,15 @@ class FlowRefiner final : public IFlowRefiner { |
57 | 59 | const Context& context) : |
58 | 60 | _phg(nullptr), |
59 | 61 | _context(context), |
| 62 | + _num_hyperedges(num_hyperedges), |
60 | 63 | _block_0(kInvalidPartition), |
61 | 64 | _block_1(kInvalidPartition), |
62 | 65 | _flow_hg(), |
63 | 66 | _sequential_hfc(_flow_hg, context.partition.seed), |
64 | 67 | _parallel_hfc(_flow_hg, context.partition.seed), |
65 | 68 | _whfc_to_node(), |
66 | | - _sequential_construction(num_hyperedges, _flow_hg, _sequential_hfc, context), |
67 | | - _parallel_construction(num_hyperedges, _flow_hg, _parallel_hfc, context) { |
| 69 | + _sequential_construction(nullptr), |
| 70 | + _parallel_construction(nullptr) { |
68 | 71 | _sequential_hfc.find_most_balanced = _context.refinement.flows.find_most_balanced_cut; |
69 | 72 | _sequential_hfc.timer.active = false; |
70 | 73 | _sequential_hfc.forceSequential(true); |
@@ -111,14 +114,15 @@ class FlowRefiner final : public IFlowRefiner { |
111 | 114 | const Context& _context; |
112 | 115 | using IFlowRefiner::_time_limit; |
113 | 116 |
|
| 117 | + HyperedgeID _num_hyperedges; |
114 | 118 | PartitionID _block_0; |
115 | 119 | PartitionID _block_1; |
116 | 120 | FlowHypergraphBuilder _flow_hg; |
117 | 121 | whfc::HyperFlowCutter<whfc::SequentialPushRelabel> _sequential_hfc; |
118 | 122 | whfc::HyperFlowCutter<whfc::ParallelPushRelabel> _parallel_hfc; |
119 | 123 |
|
120 | 124 | vec<HypernodeID> _whfc_to_node; |
121 | | - SequentialConstruction<GraphAndGainTypes> _sequential_construction; |
122 | | - ParallelConstruction<GraphAndGainTypes> _parallel_construction; |
| 125 | + std::unique_ptr<SequentialConstruction<GraphAndGainTypes>> _sequential_construction; |
| 126 | + std::unique_ptr<ParallelConstruction<GraphAndGainTypes>> _parallel_construction; |
123 | 127 | }; |
124 | 128 | } // namespace mt_kahypar |
0 commit comments