#include <ckpttn/FMGainMgr.hpp>
template<typename Gnl, typename GainCalc, class Derived>
FMGainMgr class
Template parameters | |
---|---|
Gnl | |
GainCalc | |
Derived |
Constructors, destructors, conversion operators
Public functions
- auto init(std::span<const std::uint8_t> part) -> int -> auto
- Initializes the FMGainMgr with the given partition information.
- auto is_empty_togo(uint8_t to_part) const -> bool -> auto
- Checks if the gain bucket for the given partition is empty.
- auto is_empty() const -> bool -> auto
- Checks if all the gain buckets are empty.
- auto select(std::span<const std::uint8_t> part) -> std::pair< MoveInfoV< node_t >, int > -> auto
- Selects a set of moves to perform on the given partition.
- auto select_togo(uint8_t to_part) -> std::pair< node_t, int > -> auto
- Selects a node to move to the given partition.
- auto update_move(std::span<const std::uint8_t> part, const MoveInfoV<node_t>& move_info_v) -> void -> auto
- Updates the gain information for the given set of moves.
Public variables
- GainCalc gain_calc
Protected variables
- Dllist<std::pair<node_t, uint32_t>> waiting_list
- const Gnl& hyprgraph
- std::vector<BPQueue<node_t>> gain_bucket
- std::uint8_t num_parts
Function documentation
template<typename Gnl, typename GainCalc, class Derived>
FMGainMgr<Gnl, GainCalc, Derived>:: FMGainMgr(const Gnl& hyprgraph,
std::uint8_t num_parts)
Constructs a new FMGainMgr object.
Parameters | |
---|---|
hyprgraph in | The hypergraph to manage the gains for. |
num_parts in | The number of partitions in the hypergraph. |
template<typename Gnl, typename GainCalc, class Derived>
auto FMGainMgr<Gnl, GainCalc, Derived>:: init(std::span<const std::uint8_t> part) -> int
Initializes the FMGainMgr with the given partition information.
Parameters | |
---|---|
part in | The partition information to initialize the FMGainMgr with. |
Returns | int The result of the initialization. |
template<typename Gnl, typename GainCalc, class Derived>
auto FMGainMgr<Gnl, GainCalc, Derived>:: is_empty_togo(uint8_t to_part) const -> bool
Checks if the gain bucket for the given partition is empty.
Parameters | |
---|---|
to_part in | The partition to check. |
Returns | true If the gain bucket for the given partition is empty. |
template<typename Gnl, typename GainCalc, class Derived>
auto FMGainMgr<Gnl, GainCalc, Derived>:: is_empty() const -> bool
Checks if all the gain buckets are empty.
Returns | true If all the gain buckets are empty. |
---|
template<typename Gnl, typename GainCalc, class Derived>
auto FMGainMgr<Gnl, GainCalc, Derived>:: select(std::span<const std::uint8_t> part) -> std::pair< MoveInfoV< node_t >, int >
Selects a set of moves to perform on the given partition.
Parameters | |
---|---|
part in | The current partition information. |
Returns | std::pair<MoveInfoV<node_t>, int> A pair containing the selected moves and the total gain of the moves. |
template<typename Gnl, typename GainCalc, class Derived>
auto FMGainMgr<Gnl, GainCalc, Derived>:: select_togo(uint8_t to_part) -> std::pair< node_t, int >
Selects a node to move to the given partition.
Parameters | |
---|---|
to_part in | The partition to select a node to move to. |
Returns | std::pair<node_t, int> A pair containing the selected node and the gain of moving that node. |
template<typename Gnl, typename GainCalc, class Derived>
auto FMGainMgr<Gnl, GainCalc, Derived>:: update_move(std::span<const std::uint8_t> part,
const MoveInfoV<node_t>& move_info_v) -> void
Updates the gain information for the given set of moves.
Parameters | |
---|---|
part in | The current partition information. |
move_info_v in | The set of moves to update the gain information for. |