1
0
Fork 0

Remove debug checks of alternating tree

This commit is contained in:
Joris van Rantwijk 2024-07-09 21:18:53 +02:00
parent 658a393bb8
commit c58374e6fb
1 changed files with 0 additions and 18 deletions

View File

@ -1067,22 +1067,6 @@ class MatchingContext:
else: else:
self.remove_blossom_label_t(blossom) self.remove_blossom_label_t(blossom)
def _check_alternating_tree_consistency(self) -> None:
"""TODO -- remove this function, only for debugging"""
for blossom in itertools.chain(self.trivial_blossom,
self.nontrivial_blossom):
if (blossom.parent is None) and (blossom.label != LABEL_NONE):
assert blossom.tree_blossoms is not None
assert blossom in blossom.tree_blossoms
if blossom.tree_edge is not None:
bx = self.vertex_set_node[blossom.tree_edge[0]].find()
by = self.vertex_set_node[blossom.tree_edge[1]].find()
assert bx.tree_blossoms is blossom.tree_blossoms
assert by.tree_blossoms is blossom.tree_blossoms
else:
assert blossom.tree_edge is None
assert blossom.tree_blossoms is None
def remove_alternating_tree(self, tree_blossoms: set[Blossom]) -> None: def remove_alternating_tree(self, tree_blossoms: set[Blossom]) -> None:
"""Reset the alternating tree consisting of the specified blossoms. """Reset the alternating tree consisting of the specified blossoms.
@ -1827,8 +1811,6 @@ class MatchingContext:
# This loop runs through at most O(n) iterations per stage. # This loop runs through at most O(n) iterations per stage.
while True: while True:
# self._check_alternating_tree_consistency() # TODO -- remove this
# Consider the incident edges of newly labeled S-vertices. # Consider the incident edges of newly labeled S-vertices.
self.scan_new_s_vertices() self.scan_new_s_vertices()