Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Initial commit: new datastructure for iet.
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Apr 14, 2014
1 parent 37c8a8c commit 530fe85
Show file tree
Hide file tree
Showing 7 changed files with 2,133 additions and 2,546 deletions.
4 changes: 2 additions & 2 deletions src/sage/dynamics/flat_surfaces/quadratic_strata.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __eq__(self, other):
sage: QuadraticStratum(4) == QuadraticStratum(0)
False
"""
return isinstance(self, type(other)) and self._zeroes == other._zeroes
return type(self) == type(other) and self._zeroes == other._zeroes

def __ne__(self, other):
r"""
Expand All @@ -78,7 +78,7 @@ def __ne__(self, other):
sage: QuadraticStratum(4) != QuadraticStratum(0)
True
"""
return not isinstance(self, type(other)) or self._zeroes != other._zeroes
return type(self) != type(other) or self._zeroes != other._zeroes

def genus(self):
r"""
Expand Down
11 changes: 6 additions & 5 deletions src/sage/dynamics/flat_surfaces/strata.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,8 @@ def __init__(self, *l, **d):

self._genus = Integer(self._genus)

zeroes = sorted(filter(lambda x: x > 0, self._zeroes))
zeroes = filter(lambda x: x > 0, self._zeroes)
zeroes.sort()

if self._genus == 1:
self._cc = (HypCCA,)
Expand Down Expand Up @@ -888,7 +889,7 @@ def __eq__(self, other):
...
TypeError: the right member must be a stratum
"""
if not isinstance(self, type(other)):
if type(self) != type(other):
raise TypeError("the right member must be a stratum")

return (self._marked_separatrix == other._marked_separatrix and
Expand Down Expand Up @@ -921,7 +922,7 @@ def __ne__(self, other):
...
TypeError: the right member must be a stratum
"""
if not isinstance(self, type(other)):
if type(self) != type(other):
raise TypeError("the right member must be a stratum")

return (self._marked_separatrix != other._marked_separatrix or
Expand All @@ -945,7 +946,7 @@ def __cmp__(self, other):
sage: a3_out == a3_in
False
"""
if (not isinstance(self, type(other)) or
if (type(self) != type(other) or
self._marked_separatrix != other._marked_separatrix):
raise TypeError("the other must be a stratum with same marking")

Expand Down Expand Up @@ -1412,7 +1413,7 @@ def __cmp__(self, other):
if not isinstance(other, CCA):
raise TypeError("other must be a connected component")

if isinstance(self, type(other)):
if type(self) == type(other):
if self._parent._zeroes > other._parent._zeroes:
return 1
elif self._parent._zeroes < other._parent._zeroes:
Expand Down

0 comments on commit 530fe85

Please sign in to comment.