Template Class MovePriorityQueue¶
Defined in File MoveBucket.h
Class Documentation¶
-
template<typename KeyType>
class MovePriorityQueue¶ 基于模板的通用优先队列(收益桶核心)。
通过
KeyType切换后端映射:KeyType = int:使用vector<int>直接索引,适用于按分区独立的桶;KeyType = pair<int,int>:使用unordered_map,适用于全局统一桶。
Public Functions
-
inline MovePriorityQueue(const int total, const int max_level, const graph &g)¶
开辟并激活队列,通过 total 提供快速内存槽预占,并挂入被监控图结构。
-
inline void clear()¶
清空桶并重置状态。
-
inline bool compare_element(int id_a, int id_b) const¶
元素比较方法:按收益值降序排列,收益相同时按面积升序排列。
-
inline void heap_up(int id)¶
内部堆维护:元素升值后向上调整位置。
-
inline void heap_down(int id)¶
内部堆维护:元素收益降低后向下调整位置。
-
inline Gain get(const vector<VectorXi> &occupied_resources, const graph &g, bool bound_constraint, vector<VectorXi> fpga_resources, VectorXi upper_resources, VectorXi lower_resources)¶
返回满足资源约束的最高收益可行移动。如果最高收益元素超出资源限制,则依次尝试次优元素。
-
inline bool get_active() const¶
-
inline void set_active(const bool active)¶
-
inline int get_total() const¶
Private Types
Private Functions
-
inline void mapClear()¶