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

Binary Fiduccia-Mattheyses Gain Calculator. More...

#include <FMBiGainCalc.hpp>

Public Types

using node_t = typename Gnl::node_t
 
using Item = Dllink< std::pair< node_t, uint32_t > >
 

Public Member Functions

const auto & get_init_gain_list () const
 Expose initial gain list for read-only use.
 
 FMBiGainCalc (const Gnl &hyprgraph, std::uint8_t)
 Constructs a new FMBiGainCalc object.
 
auto init (std::span< const std::uint8_t > part) -> int
 Initializes the FMBiGainCalc object.
 
auto update_move_init () -> void
 This function does nothing in 2-way partitioning.
 
void init_idx_vec (const node_t &module, const node_t &net)
 Initializes the index vector for a given vertex and net.
 
auto update_move_2pin_net (std::span< const std::uint8_t > part, const MoveInfo< node_t > &move_info) -> node_t
 Update a 2-pin net during a move operation.
 
auto update_move_3pin_net (std::span< const std::uint8_t > part, const MoveInfo< node_t > &move_info) -> std::vector< int >
 Update the gain values for a 3-pin net during a move operation.
 
auto update_move_general_net (std::span< const std::uint8_t > part, const MoveInfo< node_t > &move_info) -> std::vector< int >
 Update the gain values for a general net during a move operation.
 

Public Attributes

int delta_gain_w {}
 Delta gain for the winning partition.
 
FMPmr::vector< node_tidx_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 FMBiGainMgr< Gnl >
 

Detailed Description

template<typename Gnl>
class FMBiGainCalc< Gnl >

Binary Fiduccia-Mattheyses Gain Calculator.

The FMBiGainCalc class computes gain values for 2-way partitioning. It tracks gain values for each vertex 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

◆ Item

template<typename Gnl >
using FMBiGainCalc< Gnl >::Item = Dllink<std::pair<node_t, uint32_t> >

◆ node_t

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

Constructor & Destructor Documentation

◆ FMBiGainCalc()

template<typename Gnl >
FMBiGainCalc< Gnl >::FMBiGainCalc ( const Gnl &  hyprgraph,
std::uint8_t   
)
inlineexplicit

Constructs a new FMBiGainCalc object.

Parameters
[in]hyprgraphThe hypergraph to use for the FMBiGainCalc object.

Member Function Documentation

◆ get_init_gain_list()

template<typename Gnl >
const auto & FMBiGainCalc< Gnl >::get_init_gain_list ( ) const
inline

Expose initial gain list for read-only use.

◆ init()

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

Initializes the FMBiGainCalc object.

This function initializes the FMBiGainCalc object by resetting the total cost, vertex list, and initial gain list. It then calls the _init_gain function for each net in the hypergraph to initialize the gain values.

Parameters
[in]partThe partition information.
Returns
The total cost of the initial partition.

◆ init_idx_vec()

template<typename Gnl >
void FMBiGainCalc< Gnl >::init_idx_vec ( const node_t module,
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 given vertex and net in the FMBiGainCalc object.

Parameters
[in]moduleThe vertex to initialize the index vector for.
[in]netThe net to initialize the index vector for.

◆ update_move_2pin_net()

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

Update a 2-pin net during a move operation.

This function updates the gain values for a 2-pin net when a vertex is moved during a partitioning operation.

Parameters
[in]partThe current partition information.
[in]move_infoThe information about the move being performed.
Returns
The vertex that was moved.

◆ update_move_3pin_net()

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

Update the gain values for a 3-pin net during a move operation.

This function updates the gain values for a 3-pin net when a vertex is moved during a partitioning operation.

Parameters
[in]partThe current partition information.
[in]move_infoThe information about the move being performed.
Returns
A vector of integers representing the updated gain values for the net.

◆ update_move_general_net()

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

Update the gain values for a general net during a move operation.

This function updates the gain values for a general net (with more than 3 pins) when a vertex is moved during a partitioning operation.

Parameters
[in]partThe current partition information.
[in]move_infoThe information about the move being performed.
Returns
A vector of integers representing the updated gain values for the net.

◆ update_move_init()

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

This function does nothing in 2-way partitioning.

Friends And Related Symbol Documentation

◆ FMBiGainMgr< Gnl >

template<typename Gnl >
friend class FMBiGainMgr< Gnl >
friend

Member Data Documentation

◆ delta_gain_w

template<typename Gnl >
int FMBiGainCalc< Gnl >::delta_gain_w {}

Delta gain for the winning partition.

◆ idx_vec

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

Index vector for net vertex enumeration.

◆ special_handle_2pin_nets

template<typename Gnl >
bool FMBiGainCalc< 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: