Skip to content

Commit 122d080

Browse files
committed
Trac #22067 comment:120: make compositions_mod internal
1 parent 0a40e08 commit 122d080

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/sage/geometry/polyhedron/generating_function.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,10 +1494,10 @@ def generate_mods(equations):
14941494
else:
14951495
cols = TE.columns()
14961496
assert all(cols[j][i] == 1 for i, j in enumerate(TEi))
1497-
pre_mods = compositions_mod((tuple(ZZ(cc*m) for cc in cols[i])
1498-
for i in TEin),
1499-
m, r=(-cc*m for cc in cols[0]),
1500-
multidimensional=True)
1497+
pre_mods = _compositions_mod((tuple(ZZ(cc*m) for cc in cols[i])
1498+
for i in TEin),
1499+
m, r=(-cc*m for cc in cols[0]),
1500+
multidimensional=True)
15011501
mods = tuple({i-1: (aa.modulus(), ZZ(aa))
15021502
for i, aa in zip(TEin, a) if aa.modulus() > 1}
15031503
for a in pre_mods)
@@ -1508,7 +1508,7 @@ def generate_mods(equations):
15081508
return mods
15091509

15101510

1511-
def compositions_mod(u, m, r=0, multidimensional=False):
1511+
def _compositions_mod(u, m, r=0, multidimensional=False):
15121512
r"""
15131513
Return an iterable of all tuples `a` such that `a u^T \equiv r \mod m`.
15141514
@@ -1540,38 +1540,38 @@ def compositions_mod(u, m, r=0, multidimensional=False):
15401540
15411541
EXAMPLES::
15421542
1543-
sage: from sage.geometry.polyhedron.generating_function import compositions_mod
1543+
sage: from sage.geometry.polyhedron.generating_function import _compositions_mod
15441544
sage: def show_cm(cm):
15451545
....: print(', '.join('({})'.format(
15461546
....: ', '.join('{}mod{}'.format(aa, aa.modulus())
15471547
....: for aa in a))
15481548
....: for a in cm))
15491549
1550-
sage: list(compositions_mod([1, 1], 2))
1550+
sage: list(_compositions_mod([1, 1], 2))
15511551
[(0, 0), (1, 1)]
1552-
sage: show_cm(compositions_mod([1, 1], 2))
1552+
sage: show_cm(_compositions_mod([1, 1], 2))
15531553
(0mod2, 0mod2), (1mod2, 1mod2)
1554-
sage: show_cm(compositions_mod([1, 2, 3], 6))
1554+
sage: show_cm(_compositions_mod([1, 2, 3], 6))
15551555
(0mod6, 0mod3, 0mod2), (1mod6, 1mod3, 1mod2), (2mod6, 2mod3, 0mod2),
15561556
(3mod6, 0mod3, 1mod2), (4mod6, 1mod3, 0mod2), (5mod6, 2mod3, 1mod2)
1557-
sage: show_cm(compositions_mod([2, 2, 2], 6))
1557+
sage: show_cm(_compositions_mod([2, 2, 2], 6))
15581558
(0mod3, 0mod3, 0mod3), (0mod3, 1mod3, 2mod3), (0mod3, 2mod3, 1mod3),
15591559
(1mod3, 0mod3, 2mod3), (1mod3, 1mod3, 1mod3), (1mod3, 2mod3, 0mod3),
15601560
(2mod3, 0mod3, 1mod3), (2mod3, 1mod3, 0mod3), (2mod3, 2mod3, 2mod3)
15611561
15621562
::
15631563
1564-
sage: show_cm(compositions_mod([(1, 0), (0, 1)], 2,
1564+
sage: show_cm(_compositions_mod([(1, 0), (0, 1)], 2,
15651565
....: multidimensional=True))
15661566
(0mod2, 0mod2)
1567-
sage: show_cm(compositions_mod([(1, 2), (2, 2), (3, 2)], 6,
1567+
sage: show_cm(_compositions_mod([(1, 2), (2, 2), (3, 2)], 6,
15681568
....: multidimensional=True))
15691569
(0mod6, 0mod3, 0mod6), (1mod6, 1mod3, 1mod6), (2mod6, 2mod3, 2mod6),
15701570
(3mod6, 0mod3, 3mod6), (4mod6, 1mod3, 4mod6), (5mod6, 2mod3, 5mod6)
15711571
15721572
TESTS::
15731573
1574-
sage: show_cm(compositions_mod([1, 0], 2))
1574+
sage: show_cm(_compositions_mod([1, 0], 2))
15751575
(0mod2, 0mod1)
15761576
"""
15771577
from sage.arith.functions import lcm

0 commit comments

Comments
 (0)