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

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

#include <FMKWayGainCalc.hpp>

Public Types

using ret_info = std::vector< std::vector< int > >
 

Public Member Functions

 FMKWayGainCalc (const Gnl &hyprgraph, std::uint8_t num_parts)
 Constructs a new FMKWayGainCalc object.
 
auto init (std::span< const std::uint8_t > part) -> int
 Initializes the FMKWayGainCalc object.
 
auto update_move_init () -> void
 Resets the delta gain vector to 0.
 
auto update_move_2pin_net (std::span< const std::uint8_t > part, const MoveInfo< node_t > &move_info) -> node_t
 Updates the gain for a 2-pin net after a move.
 
void init_idx_vec (const node_t &v, const node_t &net)
 Initializes the index vector for a given vertex and net.
 
auto update_move_3pin_net (std::span< const std::uint8_t > part, const MoveInfo< node_t > &move_info) -> ret_info
 Updates the gain for a 3-pin net after a move.
 
auto update_move_general_net (std::span< const std::uint8_t > part, const MoveInfo< node_t > &move_info) -> ret_info
 Updates the gain for a general net after a move.
 

Public Attributes

FMPmr::vector< int > delta_gain_w
 Delta gain values for each partition.
 
FMPmr::vector< node_t > idx_vec
 Index vector for net vertex enumeration.
 
bool special_handle_2pin_nets {true}
 Whether to use special handling for 2-pin nets (optimization)
 

Friends

class FMKWayGainMgr< Gnl >
 

Detailed Description

template<typename Gnl>
class FMKWayGainCalc< Gnl >

K-Way Fiduccia-Mattheyses Gain Calculator.

The FMKWayGainCalc class computes gain values for k-way partitioning. It tracks gain values for each vertex in each partition based on the number of nets that would become internal (gain) or external (loss) when moving a vertex between partitions.

Template Parameters
GnlThe hypergraph type

Member Typedef Documentation

◆ ret_info

template<typename Gnl >
using FMKWayGainCalc< Gnl >::ret_info = std::vector<std::vector<int> >

Constructor & Destructor Documentation

◆ FMKWayGainCalc()

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

Constructs a new FMKWayGainCalc object.

Parameters
[in]hyprgraphThe netlist.
[in]num_partsThe number of partitions.

Member Function Documentation

◆ init()

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

Initializes the FMKWayGainCalc object.

This function resets the total cost, initializes the vertex list and init gain list to 0, and then calls the _init_gain function for each net in the hypergraph.

Parameters
[in]partThe partition to initialize.
Returns
The total cost after initialization.

◆ init_idx_vec()

template<typename Gnl >
void FMKWayGainCalc< Gnl >::init_idx_vec ( const node_t &  v,
const node_t &  net 
)

Initializes the index vector for a given vertex and net.

This function is used to initialize the index vector for a vertex within a net. It is likely an implementation detail of the FMKWayGainCalc class.

Parameters
[in]vThe vertex to initialize the index vector for.
[in]netThe net that the vertex belongs to.

◆ update_move_2pin_net()

template<typename Gnl >
auto FMKWayGainCalc< Gnl >::update_move_2pin_net ( std::span< const std::uint8_t >  part,
const MoveInfo< node_t > &  move_info 
) -> node_t

Updates the gain for a 2-pin net after a move.

This function updates the gain for a 2-pin net after a move has been performed. It takes the current partition and the move information as input, and returns the updated gain for the net.

Parameters
[in]partThe current partition.
[in]move_infoThe information about the move that was performed.
Returns
The updated gain for the 2-pin net.

◆ update_move_3pin_net()

template<typename Gnl >
auto FMKWayGainCalc< Gnl >::update_move_3pin_net ( std::span< const std::uint8_t >  part,
const MoveInfo< node_t > &  move_info 
) -> ret_info

Updates the gain for a 3-pin net after a move.

This function updates the gain for a 3-pin net after a move has been performed. It takes the current partition and the move information as input, and returns the updated gain for the net.

Parameters
[in]partThe current partition.
[in]move_infoThe information about the move that was performed.
Returns
The updated gain for the 3-pin net.

◆ update_move_general_net()

template<typename Gnl >
auto FMKWayGainCalc< Gnl >::update_move_general_net ( std::span< const std::uint8_t >  part,
const MoveInfo< node_t > &  move_info 
) -> ret_info

Updates the gain for a general net after a move.

This function updates the gain for a general net (with any number of pins) after a move has been performed. It takes the current partition and the move information as input, and returns the updated gain for the net.

Parameters
[in]partThe current partition.
[in]move_infoThe information about the move that was performed.
Returns
The updated gain for the general net. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ update_move_init()

template<typename Gnl >
auto FMKWayGainCalc< Gnl >::update_move_init ( ) -> void

Resets the delta gain vector to 0.

This function is used to initialize the delta gain vector before updating the gains for a move.

Friends And Related Symbol Documentation

◆ FMKWayGainMgr< Gnl >

template<typename Gnl >
friend class FMKWayGainMgr< Gnl >
friend

Member Data Documentation

◆ delta_gain_w

template<typename Gnl >
FMPmr::vector<int> FMKWayGainCalc< Gnl >::delta_gain_w

Delta gain values for each partition.

◆ idx_vec

template<typename Gnl >
FMPmr::vector<node_t> FMKWayGainCalc< Gnl >::idx_vec

Index vector for net vertex enumeration.

◆ special_handle_2pin_nets

template<typename Gnl >
bool FMKWayGainCalc< Gnl >::special_handle_2pin_nets {true}

Whether to use special handling for 2-pin nets (optimization)


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