@@ -85,7 +85,7 @@ cdef class FlatsMatroid(Matroid):
85
85
self ._F[i].add(frozenset (F))
86
86
self ._matroid_rank = max (self ._F, default = - 1 )
87
87
88
- cpdef groundset(self ) noexcept :
88
+ cpdef groundset(self ):
89
89
"""
90
90
Return the groundset of the matroid.
91
91
@@ -102,7 +102,7 @@ cdef class FlatsMatroid(Matroid):
102
102
"""
103
103
return self ._groundset
104
104
105
- cpdef _rank(self , X) noexcept :
105
+ cpdef _rank(self , X):
106
106
"""
107
107
Return the rank of a set ``X``.
108
108
@@ -138,7 +138,7 @@ cdef class FlatsMatroid(Matroid):
138
138
139
139
# optional
140
140
141
- cpdef full_rank(self ) noexcept :
141
+ cpdef full_rank(self ):
142
142
r """
143
143
Return the rank of the matroid.
144
144
@@ -156,7 +156,7 @@ cdef class FlatsMatroid(Matroid):
156
156
"""
157
157
return self ._matroid_rank
158
158
159
- cpdef _is_isomorphic(self , other, certificate = False ) noexcept :
159
+ cpdef _is_isomorphic(self , other, certificate = False ):
160
160
"""
161
161
Test if ``self`` is isomorphic to ``other``.
162
162
@@ -286,12 +286,7 @@ cdef class FlatsMatroid(Matroid):
286
286
sage: M.groundset() is N.groundset()
287
287
True
288
288
"""
289
- N = FlatsMatroid(groundset = [], flats = {})
290
- N._groundset = self ._groundset
291
- N._F = self ._F
292
- N._matroid_rank = self ._matroid_rank
293
- N.rename(self .get_custom_name())
294
- return N
289
+ return self
295
290
296
291
def __deepcopy__ (self , memo = None ):
297
292
"""
@@ -309,15 +304,9 @@ cdef class FlatsMatroid(Matroid):
309
304
sage: M == N
310
305
True
311
306
sage: M.groundset() is N.groundset()
312
- False
307
+ True
313
308
"""
314
- if memo is None :
315
- memo = {}
316
- from copy import deepcopy
317
- # Since matroids are immutable, N cannot reference itself in correct code, so no need to worry about the recursion.
318
- N = FlatsMatroid(groundset = deepcopy(self ._groundset, memo), flats = deepcopy(self ._F, memo))
319
- N.rename(deepcopy(self .get_custom_name(), memo))
320
- return N
309
+ return self
321
310
322
311
def __reduce__ (self ):
323
312
"""
@@ -349,7 +338,7 @@ cdef class FlatsMatroid(Matroid):
349
338
350
339
# enumeration
351
340
352
- cpdef flats(self , k) noexcept :
341
+ cpdef flats(self , k):
353
342
r """
354
343
Return the flats of the matroid of specified rank.
355
344
@@ -394,7 +383,7 @@ cdef class FlatsMatroid(Matroid):
394
383
for F in self ._F[k]:
395
384
yield F
396
385
397
- cpdef whitney_numbers2(self ) noexcept :
386
+ cpdef whitney_numbers2(self ):
398
387
r """
399
388
Return the Whitney numbers of the second kind of the matroid.
400
389
@@ -425,7 +414,7 @@ cdef class FlatsMatroid(Matroid):
425
414
426
415
# verification
427
416
428
- cpdef is_valid(self ) noexcept :
417
+ cpdef is_valid(self ):
429
418
r """
430
419
Test if ``self`` obeys the matroid axioms.
431
420
0 commit comments