PolyhedralSets/GeneratingFunction - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : PolyhedralSets/GeneratingFunction

PolyhedralSets

  

GeneratingFunction

  

returns the generating function of a polyhedron

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

GeneratingFunction(P)

Parameters

P

-

PolyhedralSet

Description

• 

The command GeneratingFunction(P) returns  the generating function of P This is a multivariate rational function with a number of variables equal to the dimension of P. If P is bounded, evaluating all the variables of GeneratingFunction(P) produces the number of integer points of P.

Examples

withPolyhedralSets:withExampleSets:withValuesUnderConstraints:

Define a polyhedron

psTetrahedron;PolyhedralSets:-Plotps

ps{Coordinates:x1,x2,x3Relations:x1x2x31,x1+x2+x31,x1x2+x31,x1+x2x31

Compute its generating function

gpsGeneratingFunctionps

gpsx12x22x32+x12x2x3+x3x1x22+x2x1x32+x1x2x3+x12+x1x2+x1x3+x22+x2x3+x32x1x2x3

(1)

Compute the number of integer points of ps, which is calculated by evaluating all variables of  gps to 1.

NumberOfIntegerPointsps

11

(2)

Define another polyhedron

psTruncatedOctahedron;PolyhedralSets:-Plotps

ps{Coordinates:x1,x2,x3Relations:x31,x31,x21,x21,x1x2x332,x2+x3x132,x11,x3+x2x132,x1+x2+x332,x1x3x232, and 4 more constraints

Compute its generating function

gpsGeneratingFunctionps

gpsx2x3x12+x22x1x3+x32x1x2+x2x1x3+x1x2+x1x3+x2x3x2x1x3

(3)

Compute the number of integer points of ps

NumberOfIntegerPointsps

7

(4)

Compute the number of integer points of a parametric polyhedron (in the parameter n) and pretty-print the result using  ValuesUnderConstraints:-ToPiecewise

NIPNumberOfIntegerPoints1i,1j,in,jn,i,j,n:ToPiecewiseNIP

ToPiecewisevalue n2 when 02+n,value 1 when n1=0

(5)

Compute the number of integer points of a parametric polyhedron (in the parameter n) and pretty-print the result

NIPNumberOfIntegerPointsi1,in,j1,ji0,i,j,n:ToPiecewiseNIP

ToPiecewisevalue 12n2+12n when 02+n,value 1 when n1=0

(6)

Compute the number of integer points of a parametric polyhedron (in the parameter n and m) and pretty-print the result

NIPNumberOfIntegerPoints1i,jn,im,3i5j,i,j,m,n:ToPiecewiseNIP

ToPiecewisevalue one of the polynomials 00251525 depending on the value of m modulo 5+nm3m210+3m10 when 0m2,05n7,05n3m1,value n when m1=0,05n4,value 5n26+n2+one of the polynomials 01313 depending on the value of n modulo 3 when 3m5n=0,05n4,value 5n26+n2+one of the polynomials 01313 depending on the value of n modulo 3 when 05n4,05n+3m1

(7)

Compute the number of integer points of a parametric polyhedron (in the parameter n, m and p) and pretty-print the result

NIPNumberOfIntegerPoints1i,in,im,1j,jp,i,j,m,n,p;ToPiecewiseNIP

NIPvalue pn when mn=0,02+n,02+p,value p when m1=0,n1=0,02+p,value n when p1=0,mn=0,02+n,value 1 when m1=0,n1=0,p1=0,value pn when 02+n,02+p,0mn1,value p when n1=0,02+p,0m2,value n when p1=0,02+n,0mn1,value 1 when n1=0,p1=0,0m2,value pm when 02+p,0m2,0n3,0m+n1,value p when m1=0,02+n,02+p,value m when p1=0,0m2,0n3,0m+n1,value 1 when m1=0,p1=0,02+n

ToPiecewisevalue pn when mn=0,02+n,02+p,value p when m1=0,n1=0,02+p,value n when p1=0,mn=0,02+n,value 1 when m1=0,n1=0,p1=0,value pn when 02+n,02+p,0mn1,value p when n1=0,02+p,0m2,value n when p1=0,02+n,0mn1,value 1 when n1=0,p1=0,0m2,value pm when 02+p,0m2,0n3,0m+n1,value p when m1=0,02+n,02+p,value m when p1=0,0m2,0n3,0m+n1,value 1 when m1=0,p1=0,02+n

(8)

References

  

Rui-Juan Jing, Yuzhuo Lei, Christopher F. S. Maligec, Marc Moreno Maza: " Counting the Integer Points of Parametric Polytopes: A Maple Implementation." Proceedings of Computer Algebra in Scientific Computing - 26th International Workshop (CASC) 2024: 140-160, Lecture Notes in Computer Science, vol. 14938, Springer. ##

Compatibility

• 

The PolyhedralSets[GeneratingFunction] command was introduced in Maple 2025.

• 

For more information on Maple 2025 changes, see Updates in Maple 2025.

See Also

PolyhedralSets[NumberOfIntegerPoints]

PolyhedralSets[GeneratingFunction]

PolyhedralSets[ZPolyhedralSets]

PolyhedralSets[IntegerHull]