1
0
Fork 0

Remove redundant clearing of scan queue

This commit is contained in:
Joris van Rantwijk 2024-06-22 14:28:24 +02:00
parent e9baa88c70
commit aab2acd78e
1 changed files with 4 additions and 3 deletions

View File

@ -858,6 +858,8 @@ class _MatchingContext:
This function takes time O(n * log(n)). This function takes time O(n * log(n)).
""" """
assert not self.scan_queue
# Remove blossom labels and unwind lazy dual updates. # Remove blossom labels and unwind lazy dual updates.
for blossom in self.trivial_blossom + self.nontrivial_blossom: for blossom in self.trivial_blossom + self.nontrivial_blossom:
if blossom.parent is None: if blossom.parent is None:
@ -867,9 +869,6 @@ class _MatchingContext:
assert blossom.label == _LABEL_NONE assert blossom.label == _LABEL_NONE
blossom.tree_edge = None blossom.tree_edge = None
# Clear the scan queue.
self.scan_queue.clear()
# Reset least-slack edge tracking. # Reset least-slack edge tracking.
self.lset_reset() self.lset_reset()
@ -1121,6 +1120,7 @@ class _MatchingContext:
sub.tree_edge = path_edges[p+1] sub.tree_edge = path_edges[p+1]
# Delete the expanded blossom. # Delete the expanded blossom.
# TODO -- list manipulation is too slow
self.nontrivial_blossom.remove(blossom) self.nontrivial_blossom.remove(blossom)
def expand_unlabeled_blossom(self, blossom: _NonTrivialBlossom) -> None: def expand_unlabeled_blossom(self, blossom: _NonTrivialBlossom) -> None:
@ -1160,6 +1160,7 @@ class _MatchingContext:
sub.delta2_node = self.delta2_queue.insert(prio, sub) sub.delta2_node = self.delta2_queue.insert(prio, sub)
# Delete the expanded blossom. # Delete the expanded blossom.
# TODO -- list manipulation is too slow
self.nontrivial_blossom.remove(blossom) self.nontrivial_blossom.remove(blossom)
# #