@@ -1494,10 +1494,10 @@ def generate_mods(equations):
1494
1494
else :
1495
1495
cols = TE .columns ()
1496
1496
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 )
1501
1501
mods = tuple ({i - 1 : (aa .modulus (), ZZ (aa ))
1502
1502
for i , aa in zip (TEin , a ) if aa .modulus () > 1 }
1503
1503
for a in pre_mods )
@@ -1508,7 +1508,7 @@ def generate_mods(equations):
1508
1508
return mods
1509
1509
1510
1510
1511
- def compositions_mod (u , m , r = 0 , multidimensional = False ):
1511
+ def _compositions_mod (u , m , r = 0 , multidimensional = False ):
1512
1512
r"""
1513
1513
Return an iterable of all tuples `a` such that `a u^T \equiv r \mod m`.
1514
1514
@@ -1540,38 +1540,38 @@ def compositions_mod(u, m, r=0, multidimensional=False):
1540
1540
1541
1541
EXAMPLES::
1542
1542
1543
- sage: from sage.geometry.polyhedron.generating_function import compositions_mod
1543
+ sage: from sage.geometry.polyhedron.generating_function import _compositions_mod
1544
1544
sage: def show_cm(cm):
1545
1545
....: print(', '.join('({})'.format(
1546
1546
....: ', '.join('{}mod{}'.format(aa, aa.modulus())
1547
1547
....: for aa in a))
1548
1548
....: for a in cm))
1549
1549
1550
- sage: list(compositions_mod ([1, 1], 2))
1550
+ sage: list(_compositions_mod ([1, 1], 2))
1551
1551
[(0, 0), (1, 1)]
1552
- sage: show_cm(compositions_mod ([1, 1], 2))
1552
+ sage: show_cm(_compositions_mod ([1, 1], 2))
1553
1553
(0mod2, 0mod2), (1mod2, 1mod2)
1554
- sage: show_cm(compositions_mod ([1, 2, 3], 6))
1554
+ sage: show_cm(_compositions_mod ([1, 2, 3], 6))
1555
1555
(0mod6, 0mod3, 0mod2), (1mod6, 1mod3, 1mod2), (2mod6, 2mod3, 0mod2),
1556
1556
(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))
1558
1558
(0mod3, 0mod3, 0mod3), (0mod3, 1mod3, 2mod3), (0mod3, 2mod3, 1mod3),
1559
1559
(1mod3, 0mod3, 2mod3), (1mod3, 1mod3, 1mod3), (1mod3, 2mod3, 0mod3),
1560
1560
(2mod3, 0mod3, 1mod3), (2mod3, 1mod3, 0mod3), (2mod3, 2mod3, 2mod3)
1561
1561
1562
1562
::
1563
1563
1564
- sage: show_cm(compositions_mod ([(1, 0), (0, 1)], 2,
1564
+ sage: show_cm(_compositions_mod ([(1, 0), (0, 1)], 2,
1565
1565
....: multidimensional=True))
1566
1566
(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,
1568
1568
....: multidimensional=True))
1569
1569
(0mod6, 0mod3, 0mod6), (1mod6, 1mod3, 1mod6), (2mod6, 2mod3, 2mod6),
1570
1570
(3mod6, 0mod3, 3mod6), (4mod6, 1mod3, 4mod6), (5mod6, 2mod3, 5mod6)
1571
1571
1572
1572
TESTS::
1573
1573
1574
- sage: show_cm(compositions_mod ([1, 0], 2))
1574
+ sage: show_cm(_compositions_mod ([1, 0], 2))
1575
1575
(0mod2, 0mod1)
1576
1576
"""
1577
1577
from sage .arith .functions import lcm
0 commit comments