67template <
typename Gnl,
typename GainMgr,
typename ConstrMgr>
107 void init(std::span<std::uint8_t> part);
142 auto final_check(std::span<const std::uint8_t> part) ->
bool {
143 return this->validator.final_check(part);
156 auto take_snapshot(std::span<const std::uint8_t> part) -> std::vector<std::uint8_t> {
164 auto snapshot = std::vector<std::uint8_t>(part.begin(), part.end());
178 auto restore_part(
const std::vector<std::uint8_t>& snapshot, std::span<std::uint8_t> part)
181 const auto N = part.size();
182 for (
auto idx = 0U; idx != N; ++idx) {
183 part[idx] = snapshot[idx];
Result of a partition legality check.
LegalCheck
Check if the move of v can be satisfied, get better, or not satisfied.
Definition LegalCheck.hpp:11
Fiduccia-Mattheyses Partitioning Algorithm Manager Base.
Definition PartMgrBase.hpp:68
int total_cost
Definition PartMgrBase.hpp:89
size_t num_parts
Number of partitions.
Definition PartMgrBase.hpp:84
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:70
GainMgr & gain_mgr
Gain manager for computing and managing gains.
Definition PartMgrBase.hpp:80
GainMgr GainMgr_
Definition PartMgrBase.hpp:71
ConstrMgr ConstrMgr_
Definition PartMgrBase.hpp:72
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:99
virtual void _optimize_1pass(std::span< std::uint8_t > part)
Performs a single pass of the FM optimization algorithm.
ConstrMgr & validator
Constraint manager for validating partition constraints.
Definition PartMgrBase.hpp:82
const Gnl & hyprgraph
Reference to the hypergraph being partitioned.
Definition PartMgrBase.hpp:78