Skip to content

Commit

Permalink
Merge pull request #13 from videlec/clean-flippability
Browse files Browse the repository at this point in the history
 flips and train tracks with GREEN or PURPLE edges
  • Loading branch information
videlec authored Jul 17, 2023
2 parents 72b63f0 + 35375d9 commit 8fa944a
Show file tree
Hide file tree
Showing 2 changed files with 168 additions and 96 deletions.
10 changes: 10 additions & 0 deletions veerer/triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
Triangulation of surfaces.
"""

import numbers
from array import array

from .permutation import *
from .env import require_package, flipper, curver

Expand Down Expand Up @@ -322,6 +324,14 @@ def _check(self, error=RuntimeError):
if self._fp[self._ep[self._vp[i]]] != i:
raise error('fev relation not satisfied')

def _check_half_edge(self, e):
if not isinstance(e, numbers.Integral):
raise TypeError('invalid half-edge {}'.format(e))
e = int(e)
if e < 0 or e >= self._n:
raise ValueError('half-edge number out of range e={}'.format(e))
return e

def __eq__(self, other):
if type(self) != type(other):
raise TypeError
Expand Down
Loading

0 comments on commit 8fa944a

Please sign in to comment.