:github_url: https://github.com/svenevs/exhale-companion .. _program_listing_file_ckpttncpp_FMGainMgr.hpp: Program Listing for File FMGainMgr.hpp ====================================== |exhale_lsh| :ref:`Return to documentation for file ` (``ckpttncpp/FMGainMgr.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include "bpqueue.hpp" // import bpqueue #include "dllist.hpp" // import dllink #include "netlist.hpp" // import Netlist #include #include #include #include #include template class FMGainMgr { Derived& self = *static_cast(this); using node_t = typename SimpleNetlist::node_t; // friend Derived; using Item = dllink>; protected: Item waitinglist {std::pair {node_t {}, uint32_t(0)}}; const SimpleNetlist& H; std::vector> gainbucket; // size_t pmax; std::uint8_t K; public: GainCalc gainCalc; // int totalcost; // FMGainMgr(FMGainMgr&&) = default; FMGainMgr(const SimpleNetlist& H, std::uint8_t K); auto init(gsl::span part) -> int; [[nodiscard]] auto is_empty_togo(uint8_t toPart) const -> bool { return this->gainbucket[toPart].is_empty(); } [[nodiscard]] auto is_empty() const -> bool { return std::all_of(this->gainbucket.cbegin(), this->gainbucket.cend(), [&](const auto& bckt) { return bckt.is_empty(); }); } auto select(gsl::span part) -> std::tuple, int>; auto select_togo(uint8_t toPart) -> std::tuple; auto update_move(gsl::span part, const MoveInfoV& move_info_v) -> void; private: auto _update_move_2pin_net(gsl::span part, const MoveInfo& move_info) -> void; auto _update_move_3pin_net(gsl::span part, const MoveInfo& move_info) -> void; auto _update_move_general_net(gsl::span part, const MoveInfo& move_info) -> void; };