:github_url: https://github.com/svenevs/exhale-companion .. _program_listing_file_ckpttncpp_FMPartMgr.hpp: Program Listing for File FMPartMgr.hpp ====================================== |exhale_lsh| :ref:`Return to documentation for file ` (``ckpttncpp/FMPartMgr.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 "PartMgrBase.hpp" #include #include template // class FMPartMgr : public PartMgrBase { using Base = PartMgrBase; public: FMPartMgr(const SimpleNetlist& H, GainMgr& gainMgr, ConstrMgr& constrMgr, size_t K) : Base {H, gainMgr, constrMgr, K} { } FMPartMgr(const SimpleNetlist& H, GainMgr& gainMgr, ConstrMgr& constrMgr) : Base {H, gainMgr, constrMgr, 2} { } auto take_snapshot(gsl::span part) -> std::vector { // const auto N = part.size(); // auto snapshot = std::vector(N, 0U); // // snapshot.reserve(N); // for (auto i = 0U; i != N; ++i) // { // snapshot[i] = part[i]; // } auto snapshot = std::vector(part.begin(), part.end()); return snapshot; } auto restore_part(const std::vector& snapshot, gsl::span part) -> void { ranges::copy(snapshot, part.begin()); // const auto N = part.size(); // for (auto i = 0U; i != N; ++i) // { // part[i] = snapshot[i]; // } } };