53template <
typename Gnl,
typename GainMgr,
typename ConstrMgr>
93 void init(std::span<std::uint8_t> part);
116 void _optimize_1pass(std::span<std::uint8_t> part);
123 auto final_check(std::span<const std::uint8_t> part) ->
bool {
124 return this->validator.final_check(part);
133 auto take_snapshot(std::span<const std::uint8_t> part) -> std::vector<std::uint8_t> {
141 auto snapshot = std::vector<std::uint8_t>(part.begin(), part.end());
151 auto restore_part(
const std::vector<std::uint8_t>& snapshot, std::span<std::uint8_t> part)
154 const auto N = part.size();
155 for (
auto idx = 0U; idx != N; ++idx) {
156 part[idx] = snapshot[idx];
LegalCheck
Check if the move of v can satisfied, GetBetter, or NotSatisfied.
Definition FMConstrMgr.hpp:22
Fiduccia-Mattheyses Partitioning Algorithm Manager Base.
Definition PartMgrBase.hpp:54
int total_cost
Definition PartMgrBase.hpp:75
size_t num_parts
Number of partitions.
Definition PartMgrBase.hpp:70
auto legalize(std::span< std::uint8_t > part) -> LegalCheck
Legalizes the partition to satisfy balance constraints.
void optimize(std::span< std::uint8_t > part)
Optimizes the partition using the FM algorithm.
typename GainMgr::GainCalc_ GainCalc_
Definition PartMgrBase.hpp:56
GainMgr & gain_mgr
Gain manager for computing and managing gains.
Definition PartMgrBase.hpp:66
GainMgr GainMgr_
Definition PartMgrBase.hpp:57
ConstrMgr ConstrMgr_
Definition PartMgrBase.hpp:58
void init(std::span< std::uint8_t > part)
Initializes the partition manager with the given partition.
PartMgrBase(const Gnl &hyprgraph, GainMgr &gain_mgr, ConstrMgr &constr_mgr, size_t num_parts)
Construct a new Part Mgr Base object.
Definition PartMgrBase.hpp:85
ConstrMgr & validator
Constraint manager for validating partition constraints.
Definition PartMgrBase.hpp:68
const Gnl & hyprgraph
Reference to the hypergraph being partitioned.
Definition PartMgrBase.hpp:64