CkPttn 1.2.4
Loading...
Searching...
No Matches
MLPartMgr.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// #include "FMPartMgr.hpp" // import FMPartMgr
12// #include <netlistx/netlist.hpp>
13// #include <memory> // std::unique_ptr
14#include <span> // for span
15// #include <py2cpp/range.hpp> // for range
16// #include <ckpttn/FMConstrMgr.hpp> // import LegalCheck
17
18// forward declare
19// template <typename nodeview_t, typename nodemap_t> struct Netlist;
20// using RngIter = decltype(py::range(1));
21// using SimpleNetlist = Netlist<RngIter, RngIter>;
22
23// using node_t = typename SimpleNetlist::node_t;
24// extern auto create_contracted_subgraph(const SimpleNetlist&, const
25// py::set<node_t>&)
26// -> std::unique_ptr<SimpleHierNetlist>;
27
28enum class LegalCheck;
29
34class MLPartMgr {
35 private:
37 double bal_tol;
39 std::uint8_t num_parts;
41 size_t limitsize{50U};
42
43 public:
46
53 explicit MLPartMgr(double bal_tol) : MLPartMgr(bal_tol, 2) {}
54
62 MLPartMgr(double bal_tol, std::uint8_t num_parts) : bal_tol{bal_tol}, num_parts{num_parts} {}
63
69 void set_limitsize(size_t limit) { this->limitsize = limit; }
70
80 template <typename Gnl, typename PartMgr>
81 auto run_Partition(const Gnl& hyprgraph, std::span<std::uint8_t> part) -> LegalCheck;
82};
LegalCheck
Check if the move of v can satisfied, GetBetter, or NotSatisfied.
Definition FMConstrMgr.hpp:22
Multilevel Partition Manager.
Definition MLPartMgr.hpp:34
MLPartMgr(double bal_tol)
Constructs a new MLPartMgr object with the given balance tolerance and a default number of partitions...
Definition MLPartMgr.hpp:53
int total_cost
Total cost of the current partitioning solution.
Definition MLPartMgr.hpp:45
MLPartMgr(double bal_tol, std::uint8_t num_parts)
Constructs a new MLPartMgr object with the given balance tolerance and number of partitions.
Definition MLPartMgr.hpp:62
void set_limitsize(size_t limit)
Sets the limit size for the partitioning.
Definition MLPartMgr.hpp:69
auto run_Partition(const Gnl &hyprgraph, std::span< std::uint8_t > part) -> LegalCheck
Runs the Fiduccia-Mattheyses (FM) partitioning algorithm on the given hypergraph.