:github_url: https://github.com/svenevs/exhale-companion .. _program_listing_file_ckpttncpp_FMBiGainMgr.hpp: Program Listing for File FMBiGainMgr.hpp ======================================== |exhale_lsh| :ref:`Return to documentation for file ` (``ckpttncpp/FMBiGainMgr.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include "FMBiGainCalc.hpp" #include "FMGainMgr.hpp" #include // struct FMBiGainMgr; class FMBiGainMgr : public FMGainMgr { public: using Base = FMGainMgr; using GainCalc_ = FMBiGainCalc; using node_t = typename SimpleNetlist::node_t; explicit FMBiGainMgr(const SimpleNetlist& H) : Base {H, 2} { } FMBiGainMgr(const SimpleNetlist& H, std::uint8_t /* K */) : Base {H, 2} { } auto init(gsl::span part) -> int; auto modify_key(const node_t& w, std::uint8_t part_w, int key) -> void { this->gainbucket[1 - part_w].modify_key( this->gainCalc.vertex_list[w], key); } auto update_move_v(const MoveInfoV& move_info_v, int gain) -> void { // this->vertex_list[v].data.second -= 2 * gain; // auto [fromPart, _ = move_info_v; this->_set_key(move_info_v.fromPart, move_info_v.v, -gain); } auto lock(uint8_t whichPart, const node_t& v) -> void { auto& vlink = this->gainCalc.vertex_list[v]; this->gainbucket[whichPart].detach(vlink); vlink.lock(); } auto lock_all(uint8_t fromPart, const node_t& v) -> void { this->lock(1 - fromPart, v); } private: auto _set_key(uint8_t whichPart, const node_t& v, int key) -> void { this->gainbucket[whichPart].set_key(this->gainCalc.vertex_list[v], key); } };