14template <
typename Node>
struct MoveInfo;
27 :
public FMGainMgr<Gnl, FMKWayGainCalc<Gnl>, FMKWayGainMgr<Gnl>> {
30 fun::Robin<std::uint8_t> rr;
52 auto init(std::span<const std::uint8_t> part) -> int;
62 auto modify_key(
const node_t& w, std::uint8_t part_w, std::span<const int> keys) ->
void {
63 for (
auto k : this->rr.exclude(part_w)) {
64 auto& item = this->
gain_calc.vertex_list[k][w];
65 if (item.is_locked()) {
87 auto& vlink = this->
gain_calc.vertex_list[whichPart][v];
101 for (
auto& vlist : this->
gain_calc.vertex_list) {
102 auto& vlink = vlist[v];
103 bckt_it->detach(vlink);
117 auto _set_key(uint8_t whichPart,
const node_t& v,
int key) ->
void {
CRTP base class for FM gain management.
K-way FM gain calculator.
Fiduccia-Mattheyses Gain Manager.
Definition FMGainMgr.hpp:32
std::uint8_t num_parts
Number of partitions.
Definition FMGainMgr.hpp:45
const Gnl & hyprgraph
Reference to the hypergraph being partitioned.
Definition FMGainMgr.hpp:41
FMKWayGainCalc< Gnl > gain_calc
Gain calculator instance.
Definition FMGainMgr.hpp:49
std::vector< BPQueue< node_t > > gain_bucket
Gain buckets for each partition (used in bucket-based gain management)
Definition FMGainMgr.hpp:43
K-Way Fiduccia-Mattheyses Gain Calculator.
Definition FMKWayGainCalc.hpp:33
K-Way Fiduccia-Mattheyses Gain Manager.
Definition FMKWayGainMgr.hpp:27
auto update_move_v(const MoveInfoV< node_t > &move_info_v, int gain) -> void
Updates the move information for a vertex.
auto init(std::span< const std::uint8_t > part) -> int
Initializes the gain manager with the given partition information.
auto lock(uint8_t whichPart, const node_t &v) -> void
Locks the vertex link for the given partition and vertex.
Definition FMKWayGainMgr.hpp:86
auto modify_key(const node_t &w, std::uint8_t part_w, std::span< const int > keys) -> void
Modifies the key for the given vertex in the gain buckets for all partitions except the given one.
Definition FMKWayGainMgr.hpp:62
auto lock_all(uint8_t, const node_t &v) -> void
Locks the vertex link for the given vertex in all partitions.
Definition FMKWayGainMgr.hpp:97
typename Gnl::node_t node_t
Definition FMKWayGainMgr.hpp:35
FMKWayGainMgr(const Gnl &hyprgraph, std::uint8_t num_parts)
Constructs a new FMKWayGainMgr object.
Definition FMKWayGainMgr.hpp:43
Move information for a single vertex (without net reference)
Definition moveinfo.hpp:37
Move information for a single vertex in a net.
Definition moveinfo.hpp:18