Skip to content

Commit 6ffbe47

Browse files
author
Matthias Koeppe
committed
sage.matroids: ./sage -fixdoctests --long --distribution 'sagemath-modules' --only-tags --probe=sage.rings.finite_rings --overwrite src/sage/matroids/*.{py,pyx}
1 parent 48b3d8d commit 6ffbe47

10 files changed

+919
-920
lines changed

src/sage/matroids/basis_exchange_matroid.pyx

Lines changed: 89 additions & 89 deletions
Large diffs are not rendered by default.

src/sage/matroids/basis_matroid.pyx

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ AUTHORS:
5555
5656
TESTS::
5757
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()
6161
6262
Methods
6363
=======
@@ -110,11 +110,11 @@ cdef class BasisMatroid(BasisExchangeMatroid):
110110
Create a BasisMatroid instance out of any other matroid::
111111
112112
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()
116116
True
117-
sage: len(set(F.bases()).difference(M.bases())) # optional - sage.rings.finite_rings
117+
sage: len(set(F.bases()).difference(M.bases()))
118118
0
119119
120120
It is possible to provide either bases or nonbases::
@@ -150,11 +150,11 @@ cdef class BasisMatroid(BasisExchangeMatroid):
150150
EXAMPLES::
151151
152152
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()
156156
True
157-
sage: len(set(F.bases()).difference(M.bases())) # optional - sage.rings.finite_rings
157+
sage: len(set(F.bases()).difference(M.bases()))
158158
0
159159
"""
160160
cdef SetSystem NB
@@ -254,8 +254,8 @@ cdef class BasisMatroid(BasisExchangeMatroid):
254254
EXAMPLES::
255255
256256
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
259259
'Matroid of rank 3 on 7 elements with 28 bases'
260260
261261
"""
@@ -429,12 +429,12 @@ cdef class BasisMatroid(BasisExchangeMatroid):
429429
430430
EXAMPLES::
431431
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()
434434
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()
436436
[1, 12, 66, 190, 258, 99, 1]
437-
sage: M.truncation().f_vector() # optional - sage.rings.finite_rings
437+
sage: M.truncation().f_vector()
438438
[1, 12, 66, 190, 258, 1]
439439
440440
"""
@@ -511,10 +511,10 @@ cdef class BasisMatroid(BasisExchangeMatroid):
511511
EXAMPLES::
512512
513513
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
516516
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')
518518
Matroid of rank 4 on 8 elements with 28 bases
519519
520520
"""
@@ -548,11 +548,11 @@ cdef class BasisMatroid(BasisExchangeMatroid):
548548
EXAMPLES::
549549
550550
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())
553553
['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())
556556
['a', 'b', 'c', 'd', 'e', 'f', 'x']
557557
558558
"""
@@ -572,10 +572,10 @@ cdef class BasisMatroid(BasisExchangeMatroid):
572572
573573
EXAMPLES::
574574
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
577577
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()
579579
28
580580
"""
581581
if self._bcount is None:
@@ -594,10 +594,10 @@ cdef class BasisMatroid(BasisExchangeMatroid):
594594
595595
EXAMPLES::
596596
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
599599
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())
601601
28
602602
"""
603603
cdef long r, n
@@ -630,10 +630,10 @@ cdef class BasisMatroid(BasisExchangeMatroid):
630630
631631
EXAMPLES::
632632
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
635635
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())
637637
7
638638
"""
639639
if self._nonbases is not None:
@@ -674,9 +674,9 @@ cdef class BasisMatroid(BasisExchangeMatroid):
674674
EXAMPLES::
675675
676676
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()
680680
True
681681
"""
682682
if self._bases_invariant_var is not None:
@@ -733,9 +733,9 @@ cdef class BasisMatroid(BasisExchangeMatroid):
733733
EXAMPLES::
734734
735735
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()
739739
False
740740
"""
741741
if self._bases_invariant2_var is None:
@@ -844,8 +844,8 @@ cdef class BasisMatroid(BasisExchangeMatroid):
844844
EXAMPLES::
845845
846846
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)])
849849
['c', 'g', 'h', 'j']
850850
851851
"""
@@ -886,12 +886,12 @@ cdef class BasisMatroid(BasisExchangeMatroid):
886886
EXAMPLES::
887887
888888
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)
893893
True
894-
sage: N._is_relaxation(M, m) # optional - sage.rings.finite_rings
894+
sage: N._is_relaxation(M, m)
895895
False
896896
"""
897897
cdef long i, j
@@ -941,12 +941,12 @@ cdef class BasisMatroid(BasisExchangeMatroid):
941941
EXAMPLES::
942942
943943
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)
948948
True
949-
sage: M._is_isomorphism(N, m) # optional - sage.rings.finite_rings
949+
sage: M._is_isomorphism(N, m)
950950
False
951951
"""
952952
if not isinstance(other, BasisMatroid):
@@ -979,9 +979,9 @@ cdef class BasisMatroid(BasisExchangeMatroid):
979979
sage: morphism = M._isomorphism(N) # optional - sage.graphs
980980
sage: M._is_isomorphism(N, morphism) # optional - sage.graphs
981981
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
985985
False
986986
"""
987987
if not isinstance(other, BasisMatroid):
@@ -1055,11 +1055,11 @@ cdef class BasisMatroid(BasisExchangeMatroid):
10551055
EXAMPLES::
10561056
10571057
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)
10611061
False
1062-
sage: M._is_isomorphic(N, certificate=True) # optional - sage.rings.finite_rings
1062+
sage: M._is_isomorphic(N, certificate=True)
10631063
(False, None)
10641064
"""
10651065
if certificate:
@@ -1127,12 +1127,12 @@ cdef class BasisMatroid(BasisExchangeMatroid):
11271127
EXAMPLES::
11281128
11291129
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)
11341134
True
1135-
sage: hash(M) == hash(O) # optional - sage.rings.finite_rings
1135+
sage: hash(M) == hash(O)
11361136
False
11371137
"""
11381138
return hash((self.groundset(), self.bases_count(), self._weak_invariant()))

0 commit comments

Comments
 (0)