@@ -29,13 +29,17 @@ def AllMatroids(n, r=None, type="all"):
29
29
30
30
INPUT:
31
31
32
- - ``n`` -- an integer; the number of elements of the matroids
33
- - ``r`` -- an integer (optional, `0 \le r \le n`); the rank of the
34
- matroids. If the type is set to ``unorientable``, then the rank must be
35
- specified.
36
- - ``type`` -- a string (default: ``all``); the type of the matroids.
37
- Either ``all``, ``unorientable``, or any other type for which there
38
- exists an ``is_type()`` attribute.
32
+ - ``n`` -- integer; the number of elements of the matroids
33
+ - ``r`` -- integer (optional); the rank of the matroids; `0 \le r \le n`
34
+ - ``type`` -- string (default: ``'all'``); the type of the matroids; must
35
+ be one of the following:
36
+
37
+ * ``'all'`` -- all matroids; available: (n=0-9), (n=0-12, r=0-2),
38
+ (n=0-11, r=3)
39
+ * ``'unorientable'`` -- all unorientable matroids; the rank ``r`` must be
40
+ specified; available: (n=7-11, r=3), (n=7-9, r=4)
41
+ * any other type for which there exists an ``is_type`` method;
42
+ availability same as for ``'all'``
39
43
40
44
OUTPUT: an iterator over matroids
41
45
@@ -80,18 +84,17 @@ def AllMatroids(n, r=None, type="all"):
80
84
....: M
81
85
Traceback (most recent call last):
82
86
...
83
- FileNotFoundError : (n=10, r=4, type="all") is not available in the database
87
+ ValueError : (n=10, r=4, type="all") is not available in the database
84
88
sage: for M in matroids.AllMatroids(12, 3, "unorientable"):
85
89
....: M
86
90
Traceback (most recent call last):
87
91
...
88
- FileNotFoundError : (n=12, r=3, type="unorientable") is not available in the database
92
+ ValueError : (n=12, r=3, type="unorientable") is not available in the database
89
93
sage: for M in matroids.AllMatroids(8, type="unorientable"):
90
94
....: M
91
95
Traceback (most recent call last):
92
96
...
93
97
ValueError: The rank needs to be specified for type "unorientable".
94
- Available: (n=7-11, r=3), (n=7-9, r=4).
95
98
sage: for M in matroids.AllMatroids(6, type="nice"):
96
99
....: M
97
100
Traceback (most recent call last):
@@ -171,10 +174,7 @@ def AllMatroids(n, r=None, type="all"):
171
174
)
172
175
173
176
if r is None and type == "unorientable" :
174
- raise ValueError (
175
- "The rank needs to be specified for type \" %s\" . " % type +
176
- "Available: (n=7-11, r=3), (n=7-9, r=4)."
177
- )
177
+ raise ValueError ("The rank needs to be specified for type \" %s\" . " % type )
178
178
179
179
if r is None :
180
180
rng = range (0 , n + 1 )
@@ -202,7 +202,7 @@ def AllMatroids(n, r=None, type="all"):
202
202
try :
203
203
fin = open (file , "r" )
204
204
except FileNotFoundError :
205
- raise FileNotFoundError (
205
+ raise ValueError (
206
206
"(n=%s, r=%s, type=\" %s\" )" % (n , r , type )
207
207
+ " is not available in the database"
208
208
)
0 commit comments