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

Fiduccia-Mattheyses Partition Constraint Manager. More...

#include <FMConstrMgr.hpp>

Inheritance diagram for FMConstrMgr< Gnl >:
Inheritance graph
[legend]

Public Member Functions

auto init (std::span< const std::uint8_t > part) -> void
 Initializes the FMConstrMgr with the given partition information.
 
auto check_legal (const MoveInfoV< node_t > &move_info_v) -> LegalCheck
 Check if the proposed move of the given nodes can be legally performed, and if so, whether it would improve the current partitioning.
 
auto check_constraints (const MoveInfoV< node_t > &move_info_v) -> bool
 Check if the proposed moves in the given vector of move information can be legally performed while satisfying the constraints.
 
auto update_move (const MoveInfoV< node_t > &move_info_v) -> void
 Update the partitioning based on the proposed node moves.
 
auto final_check (std::span< const std::uint8_t > part) -> bool
 Performs a final check on the partitioning based on the given partition information.
 

Protected Types

using node_t = typename Gnl::node_t
 

Protected Member Functions

 FMConstrMgr (const Gnl &hyprgraph, double bal_tol)
 Constructs a new FMConstrMgr object with the given hypergraph and balance tolerance, using a default of 2 partitions.
 
 FMConstrMgr (const Gnl &hyprgraph, double bal_tol, std::uint8_t num_parts)
 Constructs a new FMConstrMgr object with the given hypergraph, balance tolerance, and number of partitions.
 

Protected Attributes

std::vector< unsigned int > diff
 Difference between current partition weight and target for each partition.
 
unsigned int lowerbound {}
 Lower bound for partition weight (based on balance tolerance)
 
std::uint8_t num_parts
 Number of partitions.
 

Detailed Description

template<typename Gnl>
class FMConstrMgr< Gnl >

Fiduccia-Mattheyses Partition Constraint Manager.

Template Parameters
Gnl

Member Typedef Documentation

◆ node_t

template<typename Gnl >
using FMConstrMgr< Gnl >::node_t = typename Gnl::node_t
protected

Constructor & Destructor Documentation

◆ FMConstrMgr() [1/2]

template<typename Gnl >
FMConstrMgr< Gnl >::FMConstrMgr ( const Gnl &  hyprgraph,
double  bal_tol 
)
inlineprotected

Constructs a new FMConstrMgr object with the given hypergraph and balance tolerance, using a default of 2 partitions.

Parameters
[in]hyprgraphThe hypergraph to use for the FMConstrMgr.
[in]bal_tolThe balance tolerance to use for the FMConstrMgr.

◆ FMConstrMgr() [2/2]

template<typename Gnl >
FMConstrMgr< Gnl >::FMConstrMgr ( const Gnl &  hyprgraph,
double  bal_tol,
std::uint8_t  num_parts 
)
protected

Constructs a new FMConstrMgr object with the given hypergraph, balance tolerance, and number of partitions.

Parameters
[in]hyprgraphThe hypergraph to use for the FMConstrMgr.
[in]bal_tolThe balance tolerance to use for the FMConstrMgr.
[in]num_partsThe number of partitions to use for the FMConstrMgr.

Member Function Documentation

◆ check_constraints()

template<typename Gnl >
auto FMConstrMgr< Gnl >::check_constraints ( const MoveInfoV< node_t > &  move_info_v) -> bool

Check if the proposed moves in the given vector of move information can be legally performed while satisfying the constraints.

Parameters
[in]move_info_vA vector of information about the proposed node moves.
Returns
true If the proposed moves can be legally performed while satisfying the constraints.
false If the proposed moves cannot be legally performed or would violate the constraints.

◆ check_legal()

template<typename Gnl >
auto FMConstrMgr< Gnl >::check_legal ( const MoveInfoV< node_t > &  move_info_v) -> LegalCheck

Check if the proposed move of the given nodes can be legally performed, and if so, whether it would improve the current partitioning.

Parameters
[in]move_info_vA vector of information about the proposed node moves.
Returns
LegalCheck Indicates whether the move is not satisfied, would get better, or is fully satisfied.

◆ final_check()

template<typename Gnl >
auto FMConstrMgr< Gnl >::final_check ( std::span< const std::uint8_t >  part) -> bool

Performs a final check on the partitioning based on the given partition information.

Parameters
[in]partThe partition information to check.

◆ init()

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

Initializes the FMConstrMgr with the given partition information.

Parameters
[in]partThe partition information to initialize the FMConstrMgr with.

◆ update_move()

template<typename Gnl >
auto FMConstrMgr< Gnl >::update_move ( const MoveInfoV< node_t > &  move_info_v) -> void

Update the partitioning based on the proposed node moves.

Parameters
[in]move_info_vA vector of information about the proposed node moves.

Member Data Documentation

◆ diff

template<typename Gnl >
std::vector<unsigned int> FMConstrMgr< Gnl >::diff
protected

Difference between current partition weight and target for each partition.

◆ lowerbound

template<typename Gnl >
unsigned int FMConstrMgr< Gnl >::lowerbound {}
protected

Lower bound for partition weight (based on balance tolerance)

◆ num_parts

template<typename Gnl >
std::uint8_t FMConstrMgr< Gnl >::num_parts
protected

Number of partitions.


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