Skip to content

Commit

Permalink
some optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Oct 21, 2024
1 parent a8e59dd commit dfe7ce6
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 41 deletions.
6 changes: 5 additions & 1 deletion veerer/automaton.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def next_seed(self):
for back_neighbor, label in self._in_neighbors(state):
if self._verbosity >= 2:
print('[next_seed] add back_neighbor %s' % (back_neighbor,))
self.add_seed(back_neighbor)
self.add_seed(back_neighbor, setup=False)

def run(self, max_size=None):
r"""
Expand Down Expand Up @@ -1573,6 +1573,8 @@ def _out_neighbors(self, state, check=CHECK):
elif kind == 'horizontal-strebel':
for colouring in state.colourings():
for vt in state.veering_triangulations(colouring, HORIZONTAL, mutable=True):
# TODO: this check for Delaunay condition is costly. Maybe it could
# be amortized inside the function veering_triangulations?
if vt.is_delaunay():
vt.set_canonical_labels()
vt.set_immutable()
Expand Down Expand Up @@ -1613,6 +1615,8 @@ def _in_neighbors(self, state):
elif kind == 'vertical-strebel':
for colouring in state.colourings():
for vt in state.veering_triangulations(colouring, VERTICAL, mutable=True):
# TODO: this check for Delaunay condition is costly. Maybe it could
# be amortized inside the function veering_triangulations?
if vt.is_delaunay():
vt.set_canonical_labels()
vt.set_immutable()
Expand Down
3 changes: 0 additions & 3 deletions veerer/constellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,9 +960,6 @@ def relabel(self, p, check=True):
for l in self._data:
perm_on_list(p, l, n)

# TODO: remove check
self._check()

def _relabelling_from(self, start_edge):
r"""
Return a canonical relabelling map obtained from walking
Expand Down
1 change: 0 additions & 1 deletion veerer/triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ def triangles(self):
"""
return [c for c in perm_cycles(self._fp, True, self._n) if self._data[0][c[0]] == 0]


def boundary_faces(self):
r"""
Return the list of boundaries as lists of half-edges.
Expand Down
Loading

0 comments on commit dfe7ce6

Please sign in to comment.