diff --git a/mt-kahypar/partition/refinement/gains/cut/cut_gain_computation.h b/mt-kahypar/partition/refinement/gains/cut/cut_gain_computation.h index bfe6e9b7e..7af5970d0 100644 --- a/mt-kahypar/partition/refinement/gains/cut/cut_gain_computation.h +++ b/mt-kahypar/partition/refinement/gains/cut/cut_gain_computation.h @@ -39,12 +39,11 @@ namespace mt_kahypar { class CutGainComputation : public GainComputationBase { using Base = GainComputationBase; + using RatingMap = typename Base::RatingMap; static constexpr bool enable_heavy_assert = false; public: - using RatingMap = typename Base::RatingMap; - CutGainComputation(const Context& context, bool disable_randomization = false) : Base(context, disable_randomization) { } diff --git a/mt-kahypar/partition/refinement/gains/gain_computation_base.h b/mt-kahypar/partition/refinement/gains/gain_computation_base.h index 5aa4e4938..6f8856854 100644 --- a/mt-kahypar/partition/refinement/gains/gain_computation_base.h +++ b/mt-kahypar/partition/refinement/gains/gain_computation_base.h @@ -68,23 +68,6 @@ class GainComputationBase { RatingMap& tmp_scores = _tmp_scores.local(); Gain& isolated_block_gain = _isolated_block_gain.local(); derived->precomputeGains(phg, hn, tmp_scores, isolated_block_gain, consider_non_adjacent_blocks); - Move best_move = computeMaxGainMoveForScores(phg, tmp_scores, isolated_block_gain, hn, - rebalance, consider_non_adjacent_blocks, allow_imbalance); - - isolated_block_gain = 0; - tmp_scores.clear(); - return best_move; - } - - template - Move computeMaxGainMoveForScores(const PartitionedHypergraph& phg, - const RatingMap& tmp_scores, - const Gain isolated_block_gain, - const HypernodeID hn, - const bool rebalance = false, - const bool consider_non_adjacent_blocks = false, - const bool allow_imbalance = false) { - Derived* derived = static_cast(this); PartitionID from = phg.partID(hn); Move best_move { from, from, hn, rebalance ? std::numeric_limits::max() : 0 }; @@ -137,6 +120,8 @@ class GainComputationBase { } } + isolated_block_gain = 0; + tmp_scores.clear(); return best_move; } @@ -144,11 +129,6 @@ class GainComputationBase { _deltas.local() += AttributedGains::gain(sync_update); } - // ! Returns the local rating map for block scores - RatingMap& localScores() { - return _tmp_scores.local(); - } - // ! Returns the delta in the objective function for all moves // ! performed by the calling thread relative to the last call // ! reset() diff --git a/mt-kahypar/partition/refinement/gains/km1/km1_gain_computation.h b/mt-kahypar/partition/refinement/gains/km1/km1_gain_computation.h index 7567cfa6f..6146eb053 100644 --- a/mt-kahypar/partition/refinement/gains/km1/km1_gain_computation.h +++ b/mt-kahypar/partition/refinement/gains/km1/km1_gain_computation.h @@ -37,12 +37,11 @@ namespace mt_kahypar { class Km1GainComputation : public GainComputationBase { using Base = GainComputationBase; + using RatingMap = typename Base::RatingMap; static constexpr bool enable_heavy_assert = false; public: - using RatingMap = typename Base::RatingMap; - Km1GainComputation(const Context& context, bool disable_randomization = false) : Base(context, disable_randomization) { } diff --git a/mt-kahypar/partition/refinement/gains/soed/soed_gain_computation.h b/mt-kahypar/partition/refinement/gains/soed/soed_gain_computation.h index c1a2481d7..27683723e 100644 --- a/mt-kahypar/partition/refinement/gains/soed/soed_gain_computation.h +++ b/mt-kahypar/partition/refinement/gains/soed/soed_gain_computation.h @@ -37,12 +37,11 @@ namespace mt_kahypar { class SoedGainComputation : public GainComputationBase { using Base = GainComputationBase; + using RatingMap = typename Base::RatingMap; static constexpr bool enable_heavy_assert = false; public: - using RatingMap = typename Base::RatingMap; - SoedGainComputation(const Context& context, bool disable_randomization = false) : Base(context, disable_randomization) { } diff --git a/mt-kahypar/partition/refinement/gains/steiner_tree/steiner_tree_gain_computation.h b/mt-kahypar/partition/refinement/gains/steiner_tree/steiner_tree_gain_computation.h index dca600d48..742cc0892 100644 --- a/mt-kahypar/partition/refinement/gains/steiner_tree/steiner_tree_gain_computation.h +++ b/mt-kahypar/partition/refinement/gains/steiner_tree/steiner_tree_gain_computation.h @@ -41,13 +41,12 @@ namespace mt_kahypar { class SteinerTreeGainComputation : public GainComputationBase { using Base = GainComputationBase; + using RatingMap = typename Base::RatingMap; static constexpr bool enable_heavy_assert = false; static constexpr size_t BITS_PER_BLOCK = ds::StaticBitset::BITS_PER_BLOCK; public: - using RatingMap = typename Base::RatingMap; - SteinerTreeGainComputation(const Context& context, bool disable_randomization = false) : Base(context, disable_randomization), diff --git a/mt-kahypar/partition/refinement/gains/steiner_tree_for_graphs/steiner_tree_gain_computation_for_graphs.h b/mt-kahypar/partition/refinement/gains/steiner_tree_for_graphs/steiner_tree_gain_computation_for_graphs.h index b82b735d3..0d5700ec6 100644 --- a/mt-kahypar/partition/refinement/gains/steiner_tree_for_graphs/steiner_tree_gain_computation_for_graphs.h +++ b/mt-kahypar/partition/refinement/gains/steiner_tree_for_graphs/steiner_tree_gain_computation_for_graphs.h @@ -41,13 +41,12 @@ namespace mt_kahypar { class GraphSteinerTreeGainComputation : public GainComputationBase { using Base = GainComputationBase; + using RatingMap = typename Base::RatingMap; static constexpr bool enable_heavy_assert = false; static constexpr size_t BITS_PER_BLOCK = ds::StaticBitset::BITS_PER_BLOCK; public: - using RatingMap = typename Base::RatingMap; - GraphSteinerTreeGainComputation(const Context& context, bool disable_randomization = false) : Base(context, disable_randomization), diff --git a/mt-kahypar/partition/refinement/rebalancing/rebalancer_v2.h b/mt-kahypar/partition/refinement/rebalancing/rebalancer_v2.h index 77da17ae8..06d27fbfb 100644 --- a/mt-kahypar/partition/refinement/rebalancing/rebalancer_v2.h +++ b/mt-kahypar/partition/refinement/rebalancing/rebalancer_v2.h @@ -79,7 +79,6 @@ class RebalancerV2 final : public IRebalancer { using GainCache = typename GainTypes::GainCache; using GainCalculator = typename GainTypes::GainComputation; using AttributedGains = typename GainTypes::AttributedGains; - using RatingMap = typename GainCalculator::RatingMap; static constexpr bool debug = false; static constexpr bool enable_heavy_assert = false;