:github_url: https://github.com/svenevs/exhale-companion .. _program_listing_file_ckpttncpp_PartMgrBase.hpp: Program Listing for File PartMgrBase.hpp ======================================== |exhale_lsh| :ref:`Return to documentation for file ` (``ckpttncpp/PartMgrBase.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once // **Special code for two-pin nets** // Take a snapshot when a move make **negative** gain. // Snapshot in the form of "interface"??? // #include "netlist.hpp" // #include #include // #include // #include // #include // #include #include // forward declare template struct Netlist; // using RngIter = decltype(py::range(1)); // //using graph_t = xn::SimpleGraph; using SimpleNetlist = Netlist; enum class LegalCheck; template class Derived> // class PartMgrBase { public: using GainCalc_ = typename GainMgr::GainCalc_; using GainMgr_ = GainMgr; using ConstrMgr_ = ConstrMgr; using Der = Derived; protected: Der& self = *static_cast(this); const SimpleNetlist& H; GainMgr& gainMgr; ConstrMgr& validator; size_t K; // std::vector snapshot; // std::vector part; public: int totalcost {}; PartMgrBase(const SimpleNetlist& H, GainMgr& gainMgr, ConstrMgr& constrMgr, size_t K) : H {H} , gainMgr {gainMgr} , validator {constrMgr} , K {K} { } void init(gsl::span part); auto legalize(gsl::span part) -> LegalCheck; void optimize(gsl::span part); private: void _optimize_1pass(gsl::span part); };