CkPttn 1.2.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
FMKWayGainMgr< Gnl > Class Template Reference

K-Way Fiduccia-Mattheyses Gain Manager. More...

#include <FMKWayGainMgr.hpp>

Inheritance diagram for FMKWayGainMgr< Gnl >:
Inheritance graph
[legend]
Collaboration diagram for FMKWayGainMgr< Gnl >:
Collaboration graph
[legend]

Public Types

using Base = FMGainMgr< Gnl, FMKWayGainCalc< Gnl >, FMKWayGainMgr< Gnl > >
 
using GainCalc_ = FMKWayGainCalc< Gnl >
 
using node_t = typename Gnl::node_t
 

Public Member Functions

 FMKWayGainMgr (const Gnl &hyprgraph, std::uint8_t num_parts)
 Constructs a new FMKWayGainMgr object.
 
auto init (std::span< const std::uint8_t > part) -> int
 Initializes the gain manager with the given partition information.
 
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.
 
auto update_move_v (const MoveInfoV< node_t > &move_info_v, int gain) -> void
 Updates the move information for a vertex.
 
auto lock (uint8_t whichPart, const node_t &v) -> void
 Locks the vertex link for the given partition and vertex.
 
auto lock_all (uint8_t, const node_t &v) -> void
 Locks the vertex link for the given vertex in all partitions.
 
- Public Member Functions inherited from FMGainMgr< Gnl, FMKWayGainCalc< Gnl >, FMKWayGainMgr< Gnl > >
 FMGainMgr (const Gnl &hyprgraph, std::uint8_t num_parts)
 Constructs a new FMGainMgr object.
 
auto init (std::span< const std::uint8_t > part) -> int
 Initializes the FMGainMgr with the given partition information.
 
auto is_empty_togo (uint8_t to_part) const -> bool
 Checks if the gain bucket for the given partition is empty.
 
auto is_empty () const -> bool
 Checks if all the gain buckets are empty.
 
auto select (std::span< const std::uint8_t > part) -> std::pair< MoveInfoV< node_t >, int >
 Selects a vertex to move and computes the associated gain.
 
auto select_togo (uint8_t to_part) -> std::pair< node_t, int >
 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
 Updates the gain information for the given set of moves.
 

Additional Inherited Members

- Public Attributes inherited from FMGainMgr< Gnl, FMKWayGainCalc< Gnl >, FMKWayGainMgr< Gnl > >
FMKWayGainCalc< Gnl > gain_calc
 Gain calculator instance.
 
- Protected Attributes inherited from FMGainMgr< Gnl, FMKWayGainCalc< Gnl >, FMKWayGainMgr< Gnl > >
Dllist< std::pair< node_t, uint32_t > > waiting_list
 Waiting list for vertices awaiting movement.
 
const Gnl & hyprgraph
 Reference to the hypergraph being partitioned.
 
std::vector< BPQueue< node_t > > gain_bucket
 Gain buckets for each partition (used in bucket-based gain management)
 
std::uint8_t num_parts
 Number of partitions.
 

Detailed Description

template<typename Gnl>
class FMKWayGainMgr< Gnl >

K-Way Fiduccia-Mattheyses Gain Manager.

The FMKWayGainMgr class is a gain manager specialized for k-way partitioning. It uses the FM (Fiduccia-Mattheyses) algorithm to compute and manage gains for moving vertices among multiple partitions.

Template Parameters
GnlThe hypergraph type (Generalized Netlist)

Member Typedef Documentation

◆ Base

template<typename Gnl >
using FMKWayGainMgr< Gnl >::Base = FMGainMgr<Gnl, FMKWayGainCalc<Gnl>, FMKWayGainMgr<Gnl> >

◆ GainCalc_

template<typename Gnl >
using FMKWayGainMgr< Gnl >::GainCalc_ = FMKWayGainCalc<Gnl>

◆ node_t

template<typename Gnl >
using FMKWayGainMgr< Gnl >::node_t = typename Gnl::node_t

Constructor & Destructor Documentation

◆ FMKWayGainMgr()

template<typename Gnl >
FMKWayGainMgr< Gnl >::FMKWayGainMgr ( const Gnl &  hyprgraph,
std::uint8_t  num_parts 
)
inline

Constructs a new FMKWayGainMgr object.

Parameters
[in]hyprgraphThe hypergraph to use.
[in]num_partsThe number of partitions.

Member Function Documentation

◆ init()

template<typename Gnl >
auto FMKWayGainMgr< Gnl >::init ( std::span< const std::uint8_t >  part) -> int

Initializes the gain manager with the given partition information.

Parameters
[in]partThe partition information to initialize the gain manager with.
Returns
int The result of the initialization.

◆ lock()

template<typename Gnl >
auto FMKWayGainMgr< Gnl >::lock ( uint8_t  whichPart,
const node_t v 
) -> void
inline

Locks the vertex link for the given partition and vertex.

Parameters
[in]whichPartThe partition to lock the vertex link for.
[in]vThe vertex to lock the link for.

◆ lock_all()

template<typename Gnl >
auto FMKWayGainMgr< Gnl >::lock_all ( uint8_t  ,
const node_t v 
) -> void
inline

Locks the vertex link for the given vertex in all partitions.

Parameters
[in]vThe vertex to lock the link for.

◆ modify_key()

template<typename Gnl >
auto FMKWayGainMgr< Gnl >::modify_key ( const node_t w,
std::uint8_t  part_w,
std::span< const int >  keys 
) -> void
inline

Modifies the key for the given vertex in the gain buckets for all partitions except the given one.

Parameters
[in]wThe vertex to modify the key for.
[in]part_wThe partition that the vertex belongs to.
[in]keysThe new keys to set for the vertex in each partition.

◆ update_move_v()

template<typename Gnl >
auto FMKWayGainMgr< Gnl >::update_move_v ( const MoveInfoV< node_t > &  move_info_v,
int  gain 
) -> void

Updates the move information for a vertex.

Parameters
[in]move_info_vThe move information for the vertex.
[in]gainThe gain associated with the move.

The documentation for this class was generated from the following files: