@@ -303,7 +303,10 @@ def __init__(self, systems):
303
303
(x^2 : y^2)
304
304
"""
305
305
306
- self ._dynamical_systems = _remove_duplicates_of_ (systems )
306
+ self ._dynamical_systems = []
307
+ for ds in systems :
308
+ if ds not in self ._dynamical_systems :
309
+ self ._dynamical_systems .append (ds )
307
310
Parent .__init__ (self , category = Semigroups ().FinitelyGeneratedAsMagma ())
308
311
309
312
def __call__ (self , input ):
@@ -915,12 +918,12 @@ def __eq__(self, other):
915
918
sage: f == g
916
919
Traceback (most recent call last):
917
920
...
918
- ValueError : cannot compare dynamical semigroups with at least one generator of degree 1
921
+ NotImplementedError : cannot compare dynamical semigroups with at least one generator of degree 1
919
922
"""
920
923
if isinstance (other , DynamicalSemigroup ):
921
924
if any (ds .degree () == 1 for ds in self .defining_systems ()) or \
922
925
any (ds .degree () == 1 for ds in other .defining_systems ()):
923
- raise ValueError ("cannot compare dynamical semigroups with at least one generator of degree 1" )
926
+ raise NotImplementedError ("cannot compare dynamical semigroups with at least one generator of degree 1" )
924
927
return all (ds in other .defining_systems () for ds in self .defining_systems ()) and \
925
928
all (ds in self .defining_systems () for ds in other .defining_systems ())
926
929
return False
@@ -1146,30 +1149,6 @@ class DynamicalSemigroup_affine_field(DynamicalSemigroup_affine):
1146
1149
class DynamicalSemigroup_affine_finite_field (DynamicalSemigroup_affine_field ):
1147
1150
pass
1148
1151
1149
- def _remove_duplicates_of_ (list ):
1150
- r"""
1151
- Removes duplicate elements from a list.
1152
-
1153
- INPUT:
1154
-
1155
- - ``list`` -- any list
1156
-
1157
- OUTPUT: the original list without duplicate elements
1158
-
1159
- EXAMPLES::
1160
-
1161
- sage: numbers = [1, 1, 2, 3, 3, 2, 1, 5, 4, 3]
1162
- sage: sage.dynamics.arithmetic_dynamics.dynamical_semigroup._remove_duplicates_of_(numbers)
1163
- [1, 2, 3, 5, 4]
1164
- """
1165
- seen = []
1166
-
1167
- for item in list :
1168
- if item not in seen :
1169
- seen .append (item )
1170
-
1171
- return seen
1172
-
1173
1152
def _standardize_domains_of_ (systems ):
1174
1153
r"""
1175
1154
Coerces dynamical systems to the same domain and have the same generators.
0 commit comments