@@ -55,9 +55,9 @@ AUTHORS:
55
55
56
56
TESTS::
57
57
58
- sage: F = matroids.named_matroids.Fano() # optional - sage.rings.finite_rings
59
- sage: M = Matroid(bases=F.bases()) # optional - sage.rings.finite_rings
60
- sage: TestSuite(M).run() # optional - sage.rings.finite_rings
58
+ sage: F = matroids.named_matroids.Fano()
59
+ sage: M = Matroid(bases=F.bases())
60
+ sage: TestSuite(M).run()
61
61
62
62
Methods
63
63
=======
@@ -110,11 +110,11 @@ cdef class BasisMatroid(BasisExchangeMatroid):
110
110
Create a BasisMatroid instance out of any other matroid::
111
111
112
112
sage: from sage.matroids.advanced import *
113
- sage: F = matroids.named_matroids.Fano() # optional - sage.rings.finite_rings
114
- sage: M = BasisMatroid(F) # optional - sage.rings.finite_rings
115
- sage: F.groundset() == M.groundset() # optional - sage.rings.finite_rings
113
+ sage: F = matroids.named_matroids.Fano()
114
+ sage: M = BasisMatroid(F)
115
+ sage: F.groundset() == M.groundset()
116
116
True
117
- sage: len(set(F.bases()).difference(M.bases())) # optional - sage.rings.finite_rings
117
+ sage: len(set(F.bases()).difference(M.bases()))
118
118
0
119
119
120
120
It is possible to provide either bases or nonbases::
@@ -150,11 +150,11 @@ cdef class BasisMatroid(BasisExchangeMatroid):
150
150
EXAMPLES::
151
151
152
152
sage: from sage.matroids.advanced import *
153
- sage: F = matroids.named_matroids.Fano() # optional - sage.rings.finite_rings
154
- sage: M = BasisMatroid(F) # optional - sage.rings.finite_rings
155
- sage: F.groundset() == M.groundset() # optional - sage.rings.finite_rings
153
+ sage: F = matroids.named_matroids.Fano()
154
+ sage: M = BasisMatroid(F)
155
+ sage: F.groundset() == M.groundset()
156
156
True
157
- sage: len(set(F.bases()).difference(M.bases())) # optional - sage.rings.finite_rings
157
+ sage: len(set(F.bases()).difference(M.bases()))
158
158
0
159
159
"""
160
160
cdef SetSystem NB
@@ -254,8 +254,8 @@ cdef class BasisMatroid(BasisExchangeMatroid):
254
254
EXAMPLES::
255
255
256
256
sage: from sage.matroids.advanced import *
257
- sage: M = BasisMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
258
- sage: repr(M) # indirect doctest # optional - sage.rings.finite_rings
257
+ sage: M = BasisMatroid(matroids.named_matroids.Fano())
258
+ sage: repr(M) # indirect doctest
259
259
'Matroid of rank 3 on 7 elements with 28 bases'
260
260
261
261
"""
@@ -429,12 +429,12 @@ cdef class BasisMatroid(BasisExchangeMatroid):
429
429
430
430
EXAMPLES::
431
431
432
- sage: M = Matroid( bases=matroids. named_matroids. N2( ) . bases( )) # optional - sage . rings . finite_rings
433
- sage: M. truncation( ) # optional - sage . rings . finite_rings
432
+ sage: M = Matroid( bases=matroids. named_matroids. N2( ) . bases( ))
433
+ sage: M. truncation( )
434
434
Matroid of rank 5 on 12 elements with 702 bases
435
- sage: M. f_vector( ) # optional - sage . rings . finite_rings
435
+ sage: M. f_vector( )
436
436
[1, 12, 66, 190, 258, 99, 1 ]
437
- sage: M. truncation( ) . f_vector( ) # optional - sage . rings . finite_rings
437
+ sage: M. truncation( ) . f_vector( )
438
438
[1, 12, 66, 190, 258, 1 ]
439
439
440
440
"""
@@ -511,10 +511,10 @@ cdef class BasisMatroid(BasisExchangeMatroid):
511
511
EXAMPLES::
512
512
513
513
sage: from sage. matroids. advanced import *
514
- sage: M = BasisMatroid( matroids. named_matroids. Fano( )) # optional - sage . rings . finite_rings
515
- sage: M # optional - sage . rings . finite_rings
514
+ sage: M = BasisMatroid( matroids. named_matroids. Fano( ))
515
+ sage: M
516
516
Matroid of rank 3 on 7 elements with 28 bases
517
- sage: M. _with_coloop( 'x') # optional - sage . rings . finite_rings
517
+ sage: M. _with_coloop( 'x')
518
518
Matroid of rank 4 on 8 elements with 28 bases
519
519
520
520
"""
@@ -548,11 +548,11 @@ cdef class BasisMatroid(BasisExchangeMatroid):
548
548
EXAMPLES::
549
549
550
550
sage: from sage.matroids.advanced import *
551
- sage: M = BasisMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
552
- sage: sorted(M.groundset()) # optional - sage.rings.finite_rings
551
+ sage: M = BasisMatroid(matroids.named_matroids.Fano())
552
+ sage: sorted(M.groundset())
553
553
['a', 'b', 'c', 'd', 'e', 'f', 'g']
554
- sage: N = M.relabel({'g':'x'}) # optional - sage.rings.finite_rings
555
- sage: sorted(N.groundset()) # optional - sage.rings.finite_rings
554
+ sage: N = M.relabel({'g':'x'})
555
+ sage: sorted(N.groundset())
556
556
['a', 'b', 'c', 'd', 'e', 'f', 'x']
557
557
558
558
"""
@@ -572,10 +572,10 @@ cdef class BasisMatroid(BasisExchangeMatroid):
572
572
573
573
EXAMPLES::
574
574
575
- sage: M = Matroid( bases=matroids. named_matroids. Fano( ) . bases( )) # optional - sage . rings . finite_rings
576
- sage: M # optional - sage . rings . finite_rings
575
+ sage: M = Matroid( bases=matroids. named_matroids. Fano( ) . bases( ))
576
+ sage: M
577
577
Matroid of rank 3 on 7 elements with 28 bases
578
- sage: M. bases_count( ) # optional - sage . rings . finite_rings
578
+ sage: M. bases_count( )
579
579
28
580
580
"""
581
581
if self ._bcount is None :
@@ -594,10 +594,10 @@ cdef class BasisMatroid(BasisExchangeMatroid):
594
594
595
595
EXAMPLES::
596
596
597
- sage: M = Matroid( bases=matroids. named_matroids. Fano( ) . bases( )) # optional - sage . rings . finite_rings
598
- sage: M # optional - sage . rings . finite_rings
597
+ sage: M = Matroid( bases=matroids. named_matroids. Fano( ) . bases( ))
598
+ sage: M
599
599
Matroid of rank 3 on 7 elements with 28 bases
600
- sage: len( M. bases( )) # optional - sage . rings . finite_rings
600
+ sage: len( M. bases( ))
601
601
28
602
602
"""
603
603
cdef long r, n
@@ -630,10 +630,10 @@ cdef class BasisMatroid(BasisExchangeMatroid):
630
630
631
631
EXAMPLES::
632
632
633
- sage: M = Matroid( bases=matroids. named_matroids. Fano( ) . bases( )) # optional - sage . rings . finite_rings
634
- sage: M # optional - sage . rings . finite_rings
633
+ sage: M = Matroid( bases=matroids. named_matroids. Fano( ) . bases( ))
634
+ sage: M
635
635
Matroid of rank 3 on 7 elements with 28 bases
636
- sage: len( M. nonbases( )) # optional - sage . rings . finite_rings
636
+ sage: len( M. nonbases( ))
637
637
7
638
638
"""
639
639
if self ._nonbases is not None :
@@ -674,9 +674,9 @@ cdef class BasisMatroid(BasisExchangeMatroid):
674
674
EXAMPLES::
675
675
676
676
sage: from sage.matroids.advanced import *
677
- sage: M = BasisMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
678
- sage: N = BasisMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
679
- sage: M._bases_invariant() == N._bases_invariant() # optional - sage.rings.finite_rings
677
+ sage: M = BasisMatroid(matroids.named_matroids.Fano())
678
+ sage: N = BasisMatroid(matroids.named_matroids.Fano())
679
+ sage: M._bases_invariant() == N._bases_invariant()
680
680
True
681
681
"""
682
682
if self ._bases_invariant_var is not None :
@@ -733,9 +733,9 @@ cdef class BasisMatroid(BasisExchangeMatroid):
733
733
EXAMPLES::
734
734
735
735
sage: from sage.matroids.advanced import *
736
- sage: M = BasisMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
737
- sage: N = BasisMatroid(matroids.named_matroids.NonFano()) # optional - sage.rings.finite_rings
738
- sage: M._bases_invariant2() == N._bases_invariant2() # optional - sage.rings.finite_rings
736
+ sage: M = BasisMatroid(matroids.named_matroids.Fano())
737
+ sage: N = BasisMatroid(matroids.named_matroids.NonFano())
738
+ sage: M._bases_invariant2() == N._bases_invariant2()
739
739
False
740
740
"""
741
741
if self ._bases_invariant2_var is None :
@@ -844,8 +844,8 @@ cdef class BasisMatroid(BasisExchangeMatroid):
844
844
EXAMPLES::
845
845
846
846
sage: from sage.matroids.advanced import *
847
- sage: M = BasisMatroid(matroids.named_matroids.N1()) # optional - sage.rings.finite_rings
848
- sage: sorted([e for e in M.groundset() if M.is_distinguished(e)]) # optional - sage.rings.finite_rings
847
+ sage: M = BasisMatroid(matroids.named_matroids.N1())
848
+ sage: sorted([e for e in M.groundset() if M.is_distinguished(e)])
849
849
['c', 'g', 'h', 'j']
850
850
851
851
"""
@@ -886,12 +886,12 @@ cdef class BasisMatroid(BasisExchangeMatroid):
886
886
EXAMPLES::
887
887
888
888
sage: from sage.matroids.advanced import *
889
- sage: M = BasisMatroid(matroids.named_matroids.NonFano()) # optional - sage.rings.finite_rings
890
- sage: N = BasisMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
891
- sage: m = {e:e for e in M.groundset()} # optional - sage.rings.finite_rings
892
- sage: M._is_relaxation(N, m) # optional - sage.rings.finite_rings
889
+ sage: M = BasisMatroid(matroids.named_matroids.NonFano())
890
+ sage: N = BasisMatroid(matroids.named_matroids.Fano())
891
+ sage: m = {e:e for e in M.groundset()}
892
+ sage: M._is_relaxation(N, m)
893
893
True
894
- sage: N._is_relaxation(M, m) # optional - sage.rings.finite_rings
894
+ sage: N._is_relaxation(M, m)
895
895
False
896
896
"""
897
897
cdef long i, j
@@ -941,12 +941,12 @@ cdef class BasisMatroid(BasisExchangeMatroid):
941
941
EXAMPLES::
942
942
943
943
sage: from sage.matroids.advanced import *
944
- sage: M = BasisMatroid(matroids.named_matroids.NonFano()) # optional - sage.rings.finite_rings
945
- sage: N = BasisMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
946
- sage: m = {e:e for e in M.groundset()} # optional - sage.rings.finite_rings
947
- sage: M._is_relaxation(N, m) # optional - sage.rings.finite_rings
944
+ sage: M = BasisMatroid(matroids.named_matroids.NonFano())
945
+ sage: N = BasisMatroid(matroids.named_matroids.Fano())
946
+ sage: m = {e:e for e in M.groundset()}
947
+ sage: M._is_relaxation(N, m)
948
948
True
949
- sage: M._is_isomorphism(N, m) # optional - sage.rings.finite_rings
949
+ sage: M._is_isomorphism(N, m)
950
950
False
951
951
"""
952
952
if not isinstance (other, BasisMatroid):
@@ -979,9 +979,9 @@ cdef class BasisMatroid(BasisExchangeMatroid):
979
979
sage: morphism = M._isomorphism(N) # optional - sage.graphs
980
980
sage: M._is_isomorphism(N, morphism) # optional - sage.graphs
981
981
True
982
- sage: M = BasisMatroid(matroids.named_matroids.NonFano()) # optional - sage.rings.finite_rings
983
- sage: N = BasisMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
984
- sage: M._isomorphism(N) is not None # optional - sage.rings.finite_rings
982
+ sage: M = BasisMatroid(matroids.named_matroids.NonFano())
983
+ sage: N = BasisMatroid(matroids.named_matroids.Fano())
984
+ sage: M._isomorphism(N) is not None
985
985
False
986
986
"""
987
987
if not isinstance (other, BasisMatroid):
@@ -1055,11 +1055,11 @@ cdef class BasisMatroid(BasisExchangeMatroid):
1055
1055
EXAMPLES::
1056
1056
1057
1057
sage: from sage.matroids.advanced import *
1058
- sage: M = BasisMatroid(matroids.named_matroids.NonFano()) # optional - sage.rings.finite_rings
1059
- sage: N = BasisMatroid(matroids.named_matroids.Fano()) # optional - sage.rings.finite_rings
1060
- sage: M._is_isomorphic(N) # optional - sage.rings.finite_rings
1058
+ sage: M = BasisMatroid(matroids.named_matroids.NonFano())
1059
+ sage: N = BasisMatroid(matroids.named_matroids.Fano())
1060
+ sage: M._is_isomorphic(N)
1061
1061
False
1062
- sage: M._is_isomorphic(N, certificate=True) # optional - sage.rings.finite_rings
1062
+ sage: M._is_isomorphic(N, certificate=True)
1063
1063
(False, None)
1064
1064
"""
1065
1065
if certificate:
@@ -1127,12 +1127,12 @@ cdef class BasisMatroid(BasisExchangeMatroid):
1127
1127
EXAMPLES::
1128
1128
1129
1129
sage: from sage. matroids. advanced import *
1130
- sage: M = BasisMatroid( matroids. named_matroids. Fano( )) # optional - sage . rings . finite_rings
1131
- sage: N = BasisMatroid( matroids. named_matroids. Fano( ) . dual( )) . dual( ) # optional - sage . rings . finite_rings
1132
- sage: O = BasisMatroid( matroids. named_matroids. NonFano( )) # optional - sage . rings . finite_rings
1133
- sage: hash( M) == hash( N) # optional - sage . rings . finite_rings
1130
+ sage: M = BasisMatroid( matroids. named_matroids. Fano( ))
1131
+ sage: N = BasisMatroid( matroids. named_matroids. Fano( ) . dual( )) . dual( )
1132
+ sage: O = BasisMatroid( matroids. named_matroids. NonFano( ))
1133
+ sage: hash( M) == hash( N)
1134
1134
True
1135
- sage: hash( M) == hash( O) # optional - sage . rings . finite_rings
1135
+ sage: hash( M) == hash( O)
1136
1136
False
1137
1137
"""
1138
1138
return hash ((self .groundset(), self .bases_count(), self ._weak_invariant()))
0 commit comments