@@ -147,6 +147,7 @@ additional functionality (e.g. linear extensions).
147
147
- :meth:`chow_ring( ) <sage. matroids. matroid. Matroid. chow_ring>`
148
148
- :meth:`matroid_polytope( ) <sage. matroids. matroid. Matroid. matroid_polytope>`
149
149
- :meth:`independence_matroid_polytope( ) <sage. matroids. matroid. Matroid. independence_matroid_polytope>`
150
+ - :meth:`lattice_of_flats( ) <sage. matroids. matroid. Matroid. lattice_of_flats>`
150
151
- :meth:`orlik_solomon_algebra( ) <sage. matroids. matroid. Matroid. orlik_solomon_algebra>`
151
152
- :meth:`bergman_complex( ) <sage. matroids. matroid. Matroid. bergman_complex>`
152
153
- :meth:`augmented_bergman_complex( ) <sage. matroids. matroid. Matroid. augmented_bergman_complex>`
@@ -1113,9 +1114,9 @@ cdef class Matroid(SageObject):
1113
1114
if certificate:
1114
1115
return False , None
1115
1116
return False
1116
- YY = self .dual().independent_r_sets(cd )
1117
- for X in self .independent_r_sets (rd):
1118
- for Y in YY :
1117
+ D = self .dual()
1118
+ for X in self .independent_r_sets_iterator (rd):
1119
+ for Y in D.independent_r_sets_iterator(cd) :
1119
1120
if X.isdisjoint(Y):
1120
1121
if N._is_isomorphic(self ._minor(contractions = X, deletions = Y)):
1121
1122
if certificate:
@@ -2405,27 +2406,6 @@ cdef class Matroid(SageObject):
2405
2406
C.update([self ._cocircuit(self .groundset().difference(B).union (set ([e]))) for e in B])
2406
2407
return list (C)
2407
2408
2408
- def cocircuits_iterator (self ):
2409
- """
2410
- Return an iterator over the cocircuits of the matroid.
2411
-
2412
- .. SEEALSO::
2413
-
2414
- :meth:`M.cocircuit() <sage.matroids.matroid.Matroid.cocircuit>`
2415
-
2416
- EXAMPLES::
2417
-
2418
- sage: M = matroids.catalog.Fano()
2419
- sage: sorted([sorted(C) for C in M.cocircuits_iterator()])
2420
- [['a', 'b', 'c', 'g'], ['a', 'b', 'd', 'e'], ['a', 'c', 'd', 'f'],
2421
- ['a', 'e', 'f', 'g'], ['b', 'c', 'e', 'f'], ['b', 'd', 'f', 'g'],
2422
- ['c', 'd', 'e', 'g']]
2423
- """
2424
- C = set ()
2425
- for B in self .bases_iterator():
2426
- C.update([self ._cocircuit(self .groundset().difference(B).union (set ([e]))) for e in B])
2427
- return list (C)
2428
-
2429
2409
cpdef noncospanning_cocircuits(self ) noexcept:
2430
2410
"""
2431
2411
Return the noncospanning cocircuits of the matroid.
@@ -3019,7 +2999,7 @@ cdef class Matroid(SageObject):
3019
2999
`( w_0=1, ... , w_r) ` -- are numbers of alternating sign, where `w_i` is
3020
3000
the value of the coefficient of the `( r-i) `-th degree term of the
3021
3001
matroid's characteristic polynomial. Moreover, `| w_i| ` is the number of
3022
- `i`- faces of the broken circuit complex of the matroid.
3002
+ `( i-1 ) `-dimensional faces of the broken circuit complex of the matroid.
3023
3003
3024
3004
OUTPUT: a list of integers
3025
3005
@@ -3318,7 +3298,7 @@ cdef class Matroid(SageObject):
3318
3298
3319
3299
# polytopes
3320
3300
3321
- def matroid_polytope (self ):
3301
+ cpdef matroid_polytope(self ) noexcept :
3322
3302
r """
3323
3303
Return the matroid polytope of ``self``.
3324
3304
@@ -3357,10 +3337,15 @@ cdef class Matroid(SageObject):
3357
3337
n = self .size()
3358
3338
vector_e = FreeModule(ZZ, n).basis()
3359
3339
convert = {ind: i for i, ind in enumerate (self .groundset())}
3360
- vertices = [sum (vector_e[convert[i]] for i in B) for B in self .bases_iterator()]
3340
+ vertices = []
3341
+ for B in self .bases_iterator():
3342
+ sum = 0
3343
+ for i in B:
3344
+ sum += vector_e[convert[i]]
3345
+ vertices += [sum ]
3361
3346
return Polyhedron(vertices)
3362
3347
3363
- def independence_matroid_polytope (self ):
3348
+ cpdef independence_matroid_polytope(self ) noexcept :
3364
3349
r """
3365
3350
Return the independence matroid polytope of ``self``.
3366
3351
@@ -3400,7 +3385,12 @@ cdef class Matroid(SageObject):
3400
3385
ambient = FreeModule(ZZ, n)
3401
3386
vector_e = ambient.basis()
3402
3387
convert = {ind: i for i, ind in enumerate (self .groundset())}
3403
- vertices = [ambient.sum(vector_e[convert[i]] for i in IS) for IS in self .independent_sets_iterator()]
3388
+ vertices = []
3389
+ for IS in self .independent_sets_iterator():
3390
+ lst = []
3391
+ for i in IS:
3392
+ lst += [vector_e[convert[i]]]
3393
+ vertices += [ambient.sum(lst)]
3404
3394
return Polyhedron(vertices)
3405
3395
3406
3396
# isomorphism and equality
@@ -4256,8 +4246,7 @@ cdef class Matroid(SageObject):
4256
4246
sage: matroids.catalog.NonFano().has_minor(M)
4257
4247
True
4258
4248
sage: matroids.catalog.NonFano().has_minor(M, certificate=True)
4259
- (True, (frozenset(), frozenset({'g'}),
4260
- {0: 'b', 1: 'c', 2: 'a', 3: 'd', 4: 'e', 5: 'f'}))
4249
+ (True, (frozenset(), frozenset({...}), {...}))
4261
4250
sage: M = matroids.catalog.Fano()
4262
4251
sage: M.has_minor(M, True)
4263
4252
(True,
@@ -4735,7 +4724,7 @@ cdef class Matroid(SageObject):
4735
4724
raise ValueError (" cannot extend by element already in groundset" )
4736
4725
return extension.MatroidExtensions(self , element, line_length = line_length, subsets = subsets) # return enumerator
4737
4726
4738
- def coextensions (self , element = None , coline_length = None , subsets = None ):
4727
+ cpdef coextensions(self , element = None , coline_length = None , subsets = None ) noexcept :
4739
4728
r """
4740
4729
Return an iterable set of single-element coextensions of the matroid.
4741
4730
@@ -6632,12 +6621,12 @@ cdef class Matroid(SageObject):
6632
6621
sage: M. is_chordal( 4, 5)
6633
6622
False
6634
6623
sage: M. is_chordal( 4, 5, certificate=True)
6635
- ( False, frozenset( {'a', 'b', 'e', 'f', 'g' }))
6624
+ ( False, frozenset( {... }))
6636
6625
"""
6637
6626
cdef frozenset C
6638
6627
if k2 is None :
6639
6628
k2 = len (self .groundset()) + 1 # This is always larger than the rank
6640
- for C in self .circuits ():
6629
+ for C in self .circuits_iterator ():
6641
6630
if len (C) < k1 or len (C) > k2:
6642
6631
continue
6643
6632
if not self ._is_circuit_chordal(C):
@@ -7754,9 +7743,9 @@ cdef class Matroid(SageObject):
7754
7743
7755
7744
\c hi_M( \l ambda) = \s um_{S \s ubseteq E} ( -1) ^ {| S| }\l ambda^ {r( E) -r( S) },
7756
7745
7757
- where `E` is the groundset and`r` is the matroid's rank function. The
7746
+ where `E` is the groundset and `r` is the matroid's rank function. The
7758
7747
characteristic polynomial is also equal to
7759
- \s um_{i = 0}^ r w_i\l ambda^ {r-i}, where `\{ w_i\} _{i=0}^ r` are the
7748
+ ` \s um_{i = 0}^ r w_i\l ambda^ {r-i}` , where `\{ w_i\} _{i=0}^ r` are the
7760
7749
Whitney numbers of the first kind.
7761
7750
7762
7751
INPUT:
@@ -8106,7 +8095,7 @@ cdef class Matroid(SageObject):
8106
8095
self ._cached_info = {' plot_positions' : pos_dict, ' lineorders' : lineorders}
8107
8096
return
8108
8097
8109
- def broken_circuit_complex (self , ordering = None ):
8098
+ cpdef broken_circuit_complex(self , ordering = None ) noexcept :
8110
8099
r """
8111
8100
Return the broken circuit complex of ``self``.
8112
8101
@@ -8171,7 +8160,7 @@ cdef class Matroid(SageObject):
8171
8160
[Oxl2011 ]_, p. 189.
8172
8161
"""
8173
8162
from sage.topology.simplicial_complex import SimplicialComplex
8174
- return SimplicialComplex(self .bases()).automorphism_group()
8163
+ return SimplicialComplex(self .bases(), maximality_check = False ).automorphism_group()
8175
8164
8176
8165
cpdef bergman_complex(self ) noexcept:
8177
8166
r """
@@ -8265,7 +8254,7 @@ cdef class Matroid(SageObject):
8265
8254
"""
8266
8255
# Construct independent set complex from bases
8267
8256
from sage. topology. simplicial_complex import SimplicialComplex
8268
- IM = SimplicialComplex( self. bases( ))
8257
+ IM = SimplicialComplex( self. bases( ) , maximality_check=False )
8269
8258
8270
8259
LM = self. lattice_of_flats( )
8271
8260
@@ -8332,7 +8321,7 @@ cdef class Matroid(SageObject):
8332
8321
matroids. insert( 0, self)
8333
8322
return union_matroid. MatroidUnion( iter( matroids))
8334
8323
8335
- def direct_sum( self, matroids) :
8324
+ cpdef direct_sum( self, matroids) noexcept :
8336
8325
r"""
8337
8326
Return the matroid direct sum with another matroid or list of
8338
8327
matroids.
0 commit comments