CkPttn 1.2.4
Loading...
Searching...
No Matches
FMPartMgr.hpp
Go to the documentation of this file.
1
6#pragma once
7
8// **Special code for two-pin nets**
9// Take a snapshot when a move make **negative** gain.
10// Snapshot in the form of "interface"???
11
12#include <cstddef> // for size_t
13
14#include "PartMgrBase.hpp" // for PartMgrBase, SimpleNetlist
15
16// forward declaration
17template <typename Gnl, typename GainMgr, typename ConstrMgr> //
18class FMPartMgr;
19
33template <typename Gnl, typename GainMgr, typename ConstrMgr> //
34class FMPartMgr : public PartMgrBase<Gnl, GainMgr, ConstrMgr> {
36
37 public:
46 FMPartMgr(const Gnl& hyprgraph, GainMgr& gain_mgr, ConstrMgr& constr_mgr, size_t num_parts)
47 : Base{hyprgraph, gain_mgr, constr_mgr, num_parts} {}
48
56 FMPartMgr(const Gnl& hyprgraph, GainMgr& gain_mgr, ConstrMgr& constr_mgr)
57 : Base{hyprgraph, gain_mgr, constr_mgr, 2} {}
58
59 // /**
60 // * @brief
61 // *
62 // * @param[in] part
63 // * @return std::vector<std::uint8_t>
64 // */
65 // auto take_snapshot(std::span<const std::uint8_t> part) ->
66 // std::vector<std::uint8_t> {
67 // // const auto N = part.size();
68 // // auto snapshot = std::vector<std::uint8_t>(N, 0U);
69 // // // snapshot.reserve(N);
70 // // for (auto i = 0U; i != N; ++i)
71 // // {
72 // // snapshot[i] = part[i];
73 // // }
74 // auto snapshot = std::vector<std::uint8_t>(part.begin(), part.end());
75 // return snapshot;
76 // }
77
78 // /**
79 // * @brief
80 // *
81 // * @param[in] snapshot
82 // * @param[in,out] part
83 // */
84 // auto restore_part(const std::vector<std::uint8_t>& snapshot,
85 // std::span<std::uint8_t> part)
86 // -> void {
87 // std::copy(snapshot.begin(), snapshot.end(), part.begin());
88 // // const auto N = part.size();
89 // // for (auto i = 0U; i != N; ++i)
90 // // {
91 // // part[i] = snapshot[i];
92 // // }
93 // }
94};
Base class for Fiduccia-Mattheyses Partitioning Algorithm Manager.
Fiduccia-Mattheyses Partitioning Algorithm Manager.
Definition FMPartMgr.hpp:34
FMPartMgr(const Gnl &hyprgraph, GainMgr &gain_mgr, ConstrMgr &constr_mgr, size_t num_parts)
Constructs a new FMPartMgr object.
Definition FMPartMgr.hpp:46
FMPartMgr(const Gnl &hyprgraph, GainMgr &gain_mgr, ConstrMgr &constr_mgr)
Constructs a new FMPartMgr object.
Definition FMPartMgr.hpp:56
Fiduccia-Mattheyses Partitioning Algorithm Manager Base.
Definition PartMgrBase.hpp:54
size_t num_parts
Number of partitions.
Definition PartMgrBase.hpp:70
GainMgr & gain_mgr
Gain manager for computing and managing gains.
Definition PartMgrBase.hpp:66
const Gnl & hyprgraph
Reference to the hypergraph being partitioned.
Definition PartMgrBase.hpp:64