@@ -594,7 +594,7 @@ def _generating_function_of_integral_points_(
594
594
raise ValueError ('not all coefficient vectors of the equations '
595
595
'have the same length' )
596
596
597
- mods = TransformMod .generate_mods (equations )
597
+ mods = _TransformMod .generate_mods (equations )
598
598
logger .debug ('splitting by moduli %s' , mods )
599
599
600
600
return tuple (__generating_function_of_integral_points__ (
@@ -642,15 +642,15 @@ def __generating_function_of_integral_points__(
642
642
logger .info ('preprocessing %s inequalities and %s equations...' ,
643
643
len (inequalities ), len (equations ))
644
644
645
- T_mod = TransformMod (inequalities , equations , B , mod )
645
+ T_mod = _TransformMod (inequalities , equations , B , mod )
646
646
inequalities = T_mod .inequalities
647
647
equations = T_mod .equations
648
648
649
- T_equations = EliminateByEquations (inequalities , equations , B )
649
+ T_equations = _EliminateByEquations (inequalities , equations , B )
650
650
inequalities = T_equations .inequalities
651
651
equations = T_equations .equations
652
652
653
- T_inequalities = SplitOffSimpleInequalities (inequalities , equations , B )
653
+ T_inequalities = _SplitOffSimpleInequalities (inequalities , equations , B )
654
654
inequalities = T_inequalities .inequalities
655
655
equations = T_inequalities .equations
656
656
assert not equations
@@ -757,7 +757,7 @@ def decode_factor(factor):
757
757
return _simplify_ (numerator , terms )
758
758
759
759
760
- class TransformHrepresentation (object ):
760
+ class _TransformHrepresentation (object ):
761
761
r"""
762
762
An abstract base class for transformations of the
763
763
Hrepresentation of a polyhedron together with its
@@ -792,18 +792,18 @@ class TransformHrepresentation(object):
792
792
``equations`` is equal to the generating function of the
793
793
attributes ``inequalities`` and ``equations`` in which ``rules``
794
794
were substituted and ``factor`` was multiplied (via
795
- :meth:`~TransformHrepresentation .apply_rules`).
795
+ :meth:`~_TransformHrepresentation .apply_rules`).
796
796
"""
797
797
798
798
def __init__ (self , inequalities , equations , B ):
799
799
r"""
800
- See :class:`TransformHrepresentation ` for details.
800
+ See :class:`_TransformHrepresentation ` for details.
801
801
802
802
TESTS::
803
803
804
- sage: from sage.geometry.polyhedron.generating_function import TransformHrepresentation
804
+ sage: from sage.geometry.polyhedron.generating_function import _TransformHrepresentation
805
805
sage: B = LaurentPolynomialRing(ZZ, 'y', 2)
806
- sage: TransformHrepresentation ([(1, 2, 3)], [(0, -1, 1)], B)
806
+ sage: _TransformHrepresentation ([(1, 2, 3)], [(0, -1, 1)], B)
807
807
Traceback (most recent call last):
808
808
...
809
809
NotImplementedError
@@ -822,9 +822,9 @@ def _transform_(self):
822
822
823
823
TESTS::
824
824
825
- sage: from sage.geometry.polyhedron.generating_function import TransformHrepresentation
825
+ sage: from sage.geometry.polyhedron.generating_function import _TransformHrepresentation
826
826
sage: B = LaurentPolynomialRing(ZZ, 'y', 2)
827
- sage: TransformHrepresentation ([(1, 2, 3)], [(0, -1, 1)], B)
827
+ sage: _TransformHrepresentation ([(1, 2, 3)], [(0, -1, 1)], B)
828
828
Traceback (most recent call last):
829
829
...
830
830
NotImplementedError
@@ -852,7 +852,7 @@ def apply_rules(self, numerator, terms):
852
852
853
853
EXAMPLES::
854
854
855
- sage: from sage.geometry.polyhedron.generating_function import SplitOffSimpleInequalities as prepare
855
+ sage: from sage.geometry.polyhedron.generating_function import _SplitOffSimpleInequalities as prepare
856
856
sage: from sage.geometry.polyhedron.generating_function import _generating_function_via_Omega_ as gf
857
857
sage: B = LaurentPolynomialRing(ZZ, 'y', 3)
858
858
sage: ieqs = [(0, -1, 1, 0)]
@@ -865,7 +865,7 @@ def apply_rules(self, numerator, terms):
865
865
tuple (t .subs (self .rules ) for t in terms ))
866
866
867
867
868
- class SplitOffSimpleInequalities ( TransformHrepresentation ):
868
+ class _SplitOffSimpleInequalities ( _TransformHrepresentation ):
869
869
r"""
870
870
Split off (simple) inequalities which can be handled better
871
871
without passing them to Omega.
@@ -899,11 +899,11 @@ class SplitOffSimpleInequalities(TransformHrepresentation):
899
899
``equations`` is equal to the generating function of the
900
900
attributes ``inequalities`` and ``equations`` in which ``rules``
901
901
were substitited and ``factor`` was multiplied (via
902
- :meth:`~TransformHrepresentation .apply_rules`).
902
+ :meth:`~_TransformHrepresentation .apply_rules`).
903
903
904
904
EXAMPLES::
905
905
906
- sage: from sage.geometry.polyhedron.generating_function import SplitOffSimpleInequalities as prepare
906
+ sage: from sage.geometry.polyhedron.generating_function import _SplitOffSimpleInequalities as prepare
907
907
sage: from sage.geometry.polyhedron.generating_function import _generating_function_via_Omega_ as gf
908
908
909
909
sage: def eq(A, B):
@@ -1091,13 +1091,13 @@ def _transform_(self):
1091
1091
Do the actual transformation.
1092
1092
1093
1093
This is called during initialization.
1094
- See :class:`SplitOffSimpleInequalities ` for details.
1094
+ See :class:`_SplitOffSimpleInequalities ` for details.
1095
1095
1096
1096
TESTS::
1097
1097
1098
- sage: from sage.geometry.polyhedron.generating_function import SplitOffSimpleInequalities
1098
+ sage: from sage.geometry.polyhedron.generating_function import _SplitOffSimpleInequalities
1099
1099
sage: B = LaurentPolynomialRing(ZZ, 'y', 2)
1100
- sage: T = SplitOffSimpleInequalities ([(1, 1, 1)], [], B) # indirect doctest
1100
+ sage: T = _SplitOffSimpleInequalities ([(1, 1, 1)], [], B) # indirect doctest
1101
1101
"""
1102
1102
inequalities = self .inequalities
1103
1103
B = self .B
@@ -1175,7 +1175,7 @@ def _transform_(self):
1175
1175
self .rules = dict (rules_pre )
1176
1176
1177
1177
1178
- class EliminateByEquations ( TransformHrepresentation ):
1178
+ class _EliminateByEquations ( _TransformHrepresentation ):
1179
1179
r"""
1180
1180
Prepare the substitutions coming from "eliminated" variables
1181
1181
in the given equations.
@@ -1215,14 +1215,14 @@ class EliminateByEquations(TransformHrepresentation):
1215
1215
``equations`` is equal to the generating function of the
1216
1216
attributes ``inequalities`` and ``equations`` in which ``rules``
1217
1217
were substitited and ``factor`` was multiplied (via
1218
- :meth:`~TransformHrepresentation .apply_rules`).
1218
+ :meth:`~_TransformHrepresentation .apply_rules`).
1219
1219
1220
1220
EXAMPLES::
1221
1221
1222
- sage: from sage.geometry.polyhedron.generating_function import EliminateByEquations
1222
+ sage: from sage.geometry.polyhedron.generating_function import _EliminateByEquations
1223
1223
1224
1224
sage: def prepare_equations(equations, B):
1225
- ....: T = EliminateByEquations ([], equations, B)
1225
+ ....: T = _EliminateByEquations ([], equations, B)
1226
1226
....: return T.factor, T.rules, T.indices
1227
1227
1228
1228
sage: B = LaurentPolynomialRing(ZZ, 'y', 4)
@@ -1250,13 +1250,13 @@ def _transform_(self):
1250
1250
Do the actual transformation.
1251
1251
1252
1252
This is called during initialization.
1253
- See :class:`EliminateByEquations ` for details.
1253
+ See :class:`_EliminateByEquations ` for details.
1254
1254
1255
1255
TESTS::
1256
1256
1257
- sage: from sage.geometry.polyhedron.generating_function import EliminateByEquations
1257
+ sage: from sage.geometry.polyhedron.generating_function import _EliminateByEquations
1258
1258
sage: B = LaurentPolynomialRing(ZZ, 'y', 2)
1259
- sage: T = EliminateByEquations ([], [], B) # indirect doctest
1259
+ sage: T = _EliminateByEquations ([], [], B) # indirect doctest
1260
1260
"""
1261
1261
from sage .matrix .constructor import matrix
1262
1262
from sage .misc .misc_c import prod
@@ -1271,7 +1271,7 @@ def _transform_(self):
1271
1271
self .indices = ()
1272
1272
return
1273
1273
1274
- TE , indices , indicesn = EliminateByEquations .prepare_equations_transformation (E )
1274
+ TE , indices , indicesn = _EliminateByEquations .prepare_equations_transformation (E )
1275
1275
1276
1276
gens = (1 ,) + B .gens ()
1277
1277
z = tuple (gens [i ] for i in indices )
@@ -1314,11 +1314,11 @@ def prepare_equations_transformation(E):
1314
1314
1315
1315
TESTS::
1316
1316
1317
- sage: from sage.geometry.polyhedron.generating_function import EliminateByEquations
1317
+ sage: from sage.geometry.polyhedron.generating_function import _EliminateByEquations
1318
1318
1319
- sage: EliminateByEquations .prepare_equations_transformation(matrix([(0, 1, 0, -2)]))
1319
+ sage: _EliminateByEquations .prepare_equations_transformation(matrix([(0, 1, 0, -2)]))
1320
1320
([ 0 -1/2 0 1], (3,), (0, 1))
1321
- sage: EliminateByEquations .prepare_equations_transformation(matrix([(0, 1, -2, 0), (0, 2, 0, -3)]))
1321
+ sage: _EliminateByEquations .prepare_equations_transformation(matrix([(0, 1, -2, 0), (0, 2, 0, -3)]))
1322
1322
(
1323
1323
[ 0 -1/2 1 0]
1324
1324
[ 0 -2/3 0 1], (2, 3), (0, 1)
@@ -1344,7 +1344,7 @@ def prepare_equations_transformation(E):
1344
1344
return TE , indices , indicesn
1345
1345
1346
1346
1347
- class TransformMod ( TransformHrepresentation ):
1347
+ class _TransformMod ( _TransformHrepresentation ):
1348
1348
r"""
1349
1349
Prepare the substitutions coming from the moduli.
1350
1350
@@ -1381,15 +1381,15 @@ class TransformMod(TransformHrepresentation):
1381
1381
``equations`` is equal to the generating function of the
1382
1382
attributes ``inequalities`` and ``equations`` in which ``rules``
1383
1383
were substitited and ``factor`` was multiplied (via
1384
- :meth:`~TransformHrepresentation .apply_rules`).
1384
+ :meth:`~_TransformHrepresentation .apply_rules`).
1385
1385
1386
1386
EXAMPLES::
1387
1387
1388
- sage: from sage.geometry.polyhedron.generating_function import TransformMod
1388
+ sage: from sage.geometry.polyhedron.generating_function import _TransformMod
1389
1389
1390
1390
sage: def prepare_mod(mod, B, *vecs):
1391
1391
....: inequalities, equations = vecs
1392
- ....: T = TransformMod (inequalities, equations, B, mod)
1392
+ ....: T = _TransformMod (inequalities, equations, B, mod)
1393
1393
....: return T.factor, T.rules, T.inequalities, T.equations
1394
1394
1395
1395
sage: B = LaurentPolynomialRing(ZZ, 'y', 3)
@@ -1403,30 +1403,30 @@ class TransformMod(TransformHrepresentation):
1403
1403
1404
1404
def __init__ (self , inequalities , equations , B , mod ):
1405
1405
r"""
1406
- See :class:`TransformMod ` for details.
1406
+ See :class:`_TransformMod ` for details.
1407
1407
1408
1408
TESTS::
1409
1409
1410
- sage: from sage.geometry.polyhedron.generating_function import TransformMod
1410
+ sage: from sage.geometry.polyhedron.generating_function import _TransformMod
1411
1411
sage: B = LaurentPolynomialRing(ZZ, 'y', 2)
1412
- sage: TransformMod ([], [], B, {})
1413
- <...TransformMod object at 0x...>
1412
+ sage: _TransformMod ([], [], B, {})
1413
+ <..._TransformMod object at 0x...>
1414
1414
"""
1415
1415
self .mod = mod
1416
- super (TransformMod , self ).__init__ (inequalities , equations , B )
1416
+ super (_TransformMod , self ).__init__ (inequalities , equations , B )
1417
1417
1418
1418
def _transform_ (self ):
1419
1419
r"""
1420
1420
Do the actual transformation.
1421
1421
1422
1422
This is called during initialization.
1423
- See :class:`TransformMod ` for details.
1423
+ See :class:`_TransformMod ` for details.
1424
1424
1425
1425
TESTS::
1426
1426
1427
- sage: from sage.geometry.polyhedron.generating_function import TransformMod
1427
+ sage: from sage.geometry.polyhedron.generating_function import _TransformMod
1428
1428
sage: B = LaurentPolynomialRing(ZZ, 'y', 2)
1429
- sage: T = TransformMod ([], [], B, {}) # indirect doctest
1429
+ sage: T = _TransformMod ([], [], B, {}) # indirect doctest
1430
1430
"""
1431
1431
from sage .matrix .constructor import matrix
1432
1432
from sage .modules .free_module_element import vector
@@ -1474,16 +1474,16 @@ def generate_mods(equations):
1474
1474
1475
1475
TESTS::
1476
1476
1477
- sage: from sage.geometry.polyhedron.generating_function import TransformMod
1478
- sage: TransformMod .generate_mods([(0, 1, 1, -2)])
1477
+ sage: from sage.geometry.polyhedron.generating_function import _TransformMod
1478
+ sage: _TransformMod .generate_mods([(0, 1, 1, -2)])
1479
1479
({0: (2, 0), 1: (2, 0)}, {0: (2, 1), 1: (2, 1)})
1480
1480
"""
1481
1481
from sage .arith .all import lcm
1482
1482
from sage .matrix .constructor import matrix
1483
1483
from sage .rings .integer_ring import ZZ
1484
1484
from sage .rings .rational_field import QQ
1485
1485
1486
- TE , TEi , TEin = EliminateByEquations .prepare_equations_transformation (matrix (equations ))
1486
+ TE , TEi , TEin = _EliminateByEquations .prepare_equations_transformation (matrix (equations ))
1487
1487
TEin = TEin [1 :]
1488
1488
if TE .base_ring () == ZZ :
1489
1489
mods = [{}]
0 commit comments