CkPttn 1.2.5
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 <cstdint> // for uint8_t
15#include <span> // for span
16// #include <py2cpp/range.hpp> // for range
17// #include <ckpttn/FMConstrMgr.hpp> // import LegalCheck
18
19// forward declare
20// template <typename nodeview_t, typename nodemap_t> struct Netlist;
21// using RngIter = decltype(py::range(1));
22// using SimpleNetlist = Netlist<RngIter, RngIter>;
23
24// using node_t = typename SimpleNetlist::node_t;
25// extern auto create_contracted_subgraph(const SimpleNetlist&, const
26// py::set<node_t>&)
27// -> std::unique_ptr<SimpleHierNetlist>;
28
29#include "LegalCheck.hpp" // for LegalCheck
30
35class MLPartMgr {
36 private:
38 double bal_tol;
40 std::uint8_t num_parts;
42 size_t limitsize{50U};
43
44 public:
47
54 explicit MLPartMgr(double bal_tol) : MLPartMgr(bal_tol, 2) {}
55
63 MLPartMgr(double bal_tol, std::uint8_t num_parts) : bal_tol{bal_tol}, num_parts{num_parts} {}
64
70 void set_limitsize(size_t limit) { this->limitsize = limit; }
71
81 template <typename Gnl, typename PartMgr>
82 auto run_Partition(const Gnl& hyprgraph, std::span<std::uint8_t> part) -> LegalCheck;
83};
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
Multilevel Partition Manager.
Definition MLPartMgr.hpp:35
MLPartMgr(double bal_tol)
Constructs a new MLPartMgr object with the given balance tolerance and a default number of partitions...
Definition MLPartMgr.hpp:54
int total_cost
Total cost of the current partitioning solution.
Definition MLPartMgr.hpp:46
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:63
void set_limitsize(size_t limit)
Sets the limit size for the partitioning.
Definition MLPartMgr.hpp:70
auto run_Partition(const Gnl &hyprgraph, std::span< std::uint8_t > part) -> LegalCheck
Runs the Fiduccia-Mattheyses (FM) partitioning algorithm on the given hypergraph.