heap_items = [(float('-inf'), - 1 - i) for i in range(num)]
heapq.heapify(heap_items)
in_heap = set(exclusive)
- in_heap.update([x for x in heap_items])
+ in_heap.update([x[1] for x in heap_items])
for s, p in zip(scores, points):
if s > heap_items[0][0] and p not in in_heap:
time.time() - tic)
heap_items.sort(key=lambda item: -item[0])
- heap_items = [x for x in heap_items if x >= 0]
- logger.debug("SA iter: %d\tlast_update: %d\tmax-0: %.2f\tmax-1: %.2f\telapsed: %.2f",
- k, k_last_modify, heap_items[-1][0], heap_items[0][0], time.time() - tic)
+ heap_items = [x for x in heap_items if x[0] >= 0]
+ logger.debug("SA iter: %d\tlast_update: %d\telapsed: %.2f",
+ k, k_last_modify, time.time() - tic)
logger.debug("SA Maximums: %s", heap_items)
if self.persistent: