Skip to content

Commit 1636422

Browse files
committed
Trac #22067 comment:108: add a doctest to show split polyhedra
1 parent 811d0b9 commit 1636422

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/sage/geometry/polyhedron/generating_function.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,44 @@ def generating_function_of_integral_points(polyhedron, split=False,
348348
sage: sum(S) == G.value()
349349
True
350350
351+
We show the distinct polyhedra that are used when ``split=True`` and the
352+
resulting polyhedra that are used in the individual computations::
353+
354+
sage: import logging
355+
sage: logging.basicConfig(level=logging.INFO)
356+
sage: sum(generating_function_of_integral_points(P2[1], sort_factors=True,
357+
....: split=True))
358+
...
359+
INFO:sage.geometry.polyhedron.generating_function:(1/6) split polyhedron by b0 <= b1 <= b2
360+
INFO:sage.geometry.polyhedron.generating_function:using polyhedron
361+
b0 >= 0
362+
b1 >= b0
363+
b2 >= b1
364+
...
365+
INFO:sage.geometry.polyhedron.generating_function:(2/6) split polyhedron by b0 <= b2 < b1
366+
INFO:sage.geometry.polyhedron.generating_function:using polyhedron
367+
b2 >= b0
368+
b1 >= b2 + 1
369+
b0 >= 0
370+
...
371+
INFO:sage.geometry.polyhedron.generating_function:(3/6) split polyhedron by b1 < b0 <= b2
372+
INFO:sage.geometry.polyhedron.generating_function:using polyhedron
373+
b2 >= b0
374+
b1 >= 0
375+
b0 >= b1 + 1
376+
...
377+
INFO:sage.geometry.polyhedron.generating_function:(4/6) split polyhedron by b1 <= b2 < b0
378+
INFO:sage.geometry.polyhedron.generating_function:using polyhedron
379+
0 == 1
380+
INFO:sage.geometry.polyhedron.generating_function:(5/6) split polyhedron by b2 < b0 <= b1
381+
INFO:sage.geometry.polyhedron.generating_function:using polyhedron
382+
0 == 1
383+
INFO:sage.geometry.polyhedron.generating_function:(6/6) split polyhedron by b2 < b1 < b0
384+
INFO:sage.geometry.polyhedron.generating_function:using polyhedron
385+
0 == 1
386+
1/(-y0*y1*y2^2 + y0*y1*y2 + y0*y2^2 - y0*y2 + y1*y2 - y1 - y2 + 1)
387+
sage: logging.disable()
388+
351389
::
352390
353391
sage: generating_function_of_integral_points(

0 commit comments

Comments
 (0)