Skip to content

Commit f0183d4

Browse files
committed
document&test corner case, empty domain without constraints
1 parent 9094f40 commit f0183d4

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

src/sage/combinat/integer_vectors_mod_permgroup.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ class IntegerVectorsModPermutationGroup(UniqueRepresentation):
7979
8080
OUTPUT:
8181
82-
- If ``sum`` and ``max_part`` are None, it returns the infinite enumerated
83-
set of all integer vectors (list of integers) maximal in their orbit for
84-
the lexicographic order.
82+
- If ``sum`` and ``max_part`` are None, it returns the infinite
83+
enumerated set of all integer vectors (lists of integers) maximal
84+
in their orbit for the lexicographic order. Exceptionally, if
85+
the domain of ``G`` is empty, the result is a finite enumerated
86+
set that contains one element, namely the empty vector.
8587
86-
- If ``sum`` is an integer, it returns a finite enumerated set containing
87-
all integer vectors maximal in their orbit for the lexicographic order
88-
and whose entries sum to ``sum``.
88+
- If ``sum`` is an integer, it returns a finite enumerated set
89+
containing all integer vectors maximal in their orbit for the
90+
lexicographic order and whose entries sum to ``sum``.
8991
9092
EXAMPLES:
9193
@@ -164,6 +166,15 @@ class IntegerVectorsModPermutationGroup(UniqueRepresentation):
164166
sage: I.orbit([2,2,2])
165167
{[2, 2, 2]}
166168
169+
Even without constraints, for an empty domain the result is
170+
a singleton set::
171+
172+
sage: G = PermutationGroup([], domain=[])
173+
sage: sgs = tuple(tuple(s) for s in G.strong_generating_system())
174+
sage: list(IntegerVectorsModPermutationGroup(G, sgs=sgs))
175+
[[]]
176+
177+
167178
TESTS:
168179
169180
Let us check that canonical integer vectors of the symmetric group
@@ -196,15 +207,16 @@ class IntegerVectorsModPermutationGroup(UniqueRepresentation):
196207
18
197208
23
198209
199-
We present a last corner case: trivial groups. For the trivial
200-
group ``G`` acting on a list of length `n`, all integer vectors of
201-
length `n` are canonical::
210+
Another corner case is trivial groups. For the trivial group ``G``
211+
acting on a list of length `n`, all integer vectors of length `n`
212+
are canonical::
202213
203214
sage: # long time
204215
sage: G = PermutationGroup([[(6,)]])
205216
sage: G.cardinality()
206217
1
207-
sage: I = IntegerVectorsModPermutationGroup(G)
218+
sage: sgs = tuple(tuple(s) for s in G.strong_generating_system())
219+
sage: I = IntegerVectorsModPermutationGroup(G, sgs=sgs)
208220
sage: for i in range(10):
209221
....: d1 = I.subset(i).cardinality()
210222
....: d2 = IntegerVectors(i,6).cardinality()
@@ -220,6 +232,7 @@ class IntegerVectorsModPermutationGroup(UniqueRepresentation):
220232
792
221233
1287
222234
2002
235+
223236
"""
224237
@staticmethod
225238
def __classcall__(cls, G, sum=None, max_part=None, sgs=None):

0 commit comments

Comments
 (0)