@@ -1232,27 +1232,26 @@ cdef class BasisExchangeMatroid(Matroid):
1232
1232
1233
1233
# enumeration
1234
1234
1235
- cpdef f_vector (self ) noexcept:
1235
+ cpdef whitney_numbers2 (self ) noexcept:
1236
1236
r """
1237
- Return the `f`-vector of the matroid.
1237
+ Return the Whitney numbers of the second kind of the matroid.
1238
1238
1239
- The `f`-* vector* is a vector `( f_0, ... , f_r) `, where `f_i` is the
1240
- number of flats of rank `i`, and `r` is the rank of the matroid.
1239
+ The Whitney numbers of the second kind are here encoded as a vector
1240
+ `( W_0, ... , W_r) `, where `W_i` is the number of flats of rank `i`, and
1241
+ `r` is the rank of the matroid.
1241
1242
1242
- OUTPUT:
1243
-
1244
- List of integers.
1243
+ OUTPUT: a list of integers
1245
1244
1246
1245
EXAMPLES::
1247
1246
1248
1247
sage: M = matroids. catalog. S8( )
1249
- sage: M. f_vector ( )
1248
+ sage: M. whitney_numbers2 ( )
1250
1249
[1, 8, 22, 14, 1 ]
1251
1250
"""
1252
1251
cdef bitset_t * flats
1253
1252
cdef bitset_t * todo
1254
1253
if self ._matroid_rank == 0 :
1255
- return [0 ]
1254
+ return [1 ]
1256
1255
flats = < bitset_t* > sig_malloc((self .full_rank() + 1 ) * sizeof(bitset_t))
1257
1256
todo = < bitset_t* > sig_malloc((self .full_rank() + 1 ) * sizeof(bitset_t))
1258
1257
@@ -1264,17 +1263,17 @@ cdef class BasisExchangeMatroid(Matroid):
1264
1263
bitset_clear(todo[0 ])
1265
1264
self .__closure(flats[0 ], todo[0 ])
1266
1265
bitset_complement(todo[0 ], flats[0 ])
1267
- self ._f_vector_rec (f_vec, flats, todo, 0 , 0 )
1266
+ self ._whitney_numbers2_rec (f_vec, flats, todo, 0 , 0 )
1268
1267
for i in range (self .full_rank() + 1 ):
1269
1268
bitset_free(flats[i])
1270
1269
bitset_free(todo[i])
1271
1270
sig_free(flats)
1272
1271
sig_free(todo)
1273
1272
return f_vec
1274
1273
1275
- cdef _f_vector_rec (self , object f_vec, bitset_t* flats, bitset_t* todo, long elt, long i) noexcept:
1274
+ cdef _whitney_numbers2_rec (self , object f_vec, bitset_t* flats, bitset_t* todo, long elt, long i) noexcept:
1276
1275
"""
1277
- Recursion for the f_vector method.
1276
+ Recursion for the whitney_numbers2 method.
1278
1277
"""
1279
1278
cdef long e
1280
1279
f_vec[i] += 1
@@ -1287,7 +1286,7 @@ cdef class BasisExchangeMatroid(Matroid):
1287
1286
bitset_difference(todo[i + 1 ], flats[i + 1 ], flats[i])
1288
1287
if bitset_first(todo[i + 1 ]) == e:
1289
1288
bitset_copy(todo[i + 1 ], todo[i])
1290
- self ._f_vector_rec (f_vec, flats, todo, e + 1 , i + 1 )
1289
+ self ._whitney_numbers2_rec (f_vec, flats, todo, e + 1 , i + 1 )
1291
1290
e = bitset_next(todo[i], e)
1292
1291
1293
1292
cpdef flats(self , r) noexcept:
@@ -1311,7 +1310,7 @@ cdef class BasisExchangeMatroid(Matroid):
1311
1310
EXAMPLES::
1312
1311
1313
1312
sage: M = matroids.catalog.S8()
1314
- sage: M.f_vector ()
1313
+ sage: M.whitney_numbers2 ()
1315
1314
[1, 8, 22, 14, 1]
1316
1315
sage: len(M.flats(2))
1317
1316
22
@@ -1386,7 +1385,7 @@ cdef class BasisExchangeMatroid(Matroid):
1386
1385
EXAMPLES::
1387
1386
1388
1387
sage: M = matroids.catalog.S8().dual()
1389
- sage: M.f_vector ()
1388
+ sage: M.whitney_numbers2 ()
1390
1389
[1, 8, 22, 14, 1]
1391
1390
sage: len(M.coflats(2))
1392
1391
22
@@ -1957,8 +1956,8 @@ cdef class BasisExchangeMatroid(Matroid):
1957
1956
else :
1958
1957
k = min (self .full_rank() - 1 , 2 )
1959
1958
fie, f_vec = self ._flat_element_inv(k)
1960
- self ._weak_invariant_var = hash (tuple ([tuple ([(f, len (fie[f])) for f in sorted (fie)]), f_vec]))
1961
- self ._weak_partition_var = SetSystem(self ._E, [fie[f] for f in sorted (fie)])
1959
+ self ._weak_invariant_var = hash (tuple ([tuple ([(f, len (fie[f])) for f in sorted (fie, key = str )]), f_vec]))
1960
+ self ._weak_partition_var = SetSystem(self ._E, [fie[f] for f in sorted (fie, key = str )])
1962
1961
return self ._weak_invariant_var
1963
1962
1964
1963
cpdef _weak_partition(self ) noexcept:
0 commit comments