IsIntegerPointOf - Maple Help

PolyhedralSets[ZPolyhedralSets]

 IsIntegerPointOf
 check whether a point is in a ZPolyhedralSet

 Calling Sequence IsIntegerPointOf(zpoly,v)

Parameters

 zpoly - v - an integer point in Vector form

Description

 • IsIntegerPointOf(zpoly,v) returns true if v is a point of zpoly, false otherwise.
 • Note that the coordinates of v must be integer numbers.

Examples

 > $\mathrm{with}\left(\mathrm{PolyhedralSets}\right):$
 > $\mathrm{with}\left(\mathrm{ZPolyhedralSets}\right):$

Create a Z-polyhedron in the three-dimensional space

 > $\mathrm{ineqs}≔\left[0\le -16+2y+z,0\le -72+4x+4y+3z,0\le 2y-z,0\le -24+4x+4y-3z,0\le -4x+4y+3z,0\le 48-4x+4y-3z,0\le 48-4x-4y+3z,0\le 8-2y+z,0\le -24+4x-4y+3z,0\le 24-2y-z,0\le 24+4x-4y-3z,0\le 96-4x-4y-3z\right]$
 ${\mathrm{ineqs}}{≔}\left[{0}{\le }{-}{16}{+}{2}{}{y}{+}{z}{,}{0}{\le }{-}{72}{+}{4}{}{x}{+}{4}{}{y}{+}{3}{}{z}{,}{0}{\le }{2}{}{y}{-}{z}{,}{0}{\le }{-}{24}{+}{4}{}{x}{+}{4}{}{y}{-}{3}{}{z}{,}{0}{\le }{-}{4}{}{x}{+}{4}{}{y}{+}{3}{}{z}{,}{0}{\le }{48}{-}{4}{}{x}{+}{4}{}{y}{-}{3}{}{z}{,}{0}{\le }{48}{-}{4}{}{x}{-}{4}{}{y}{+}{3}{}{z}{,}{0}{\le }{8}{-}{2}{}{y}{+}{z}{,}{0}{\le }{-}{24}{+}{4}{}{x}{-}{4}{}{y}{+}{3}{}{z}{,}{0}{\le }{24}{-}{2}{}{y}{-}{z}{,}{0}{\le }{24}{+}{4}{}{x}{-}{4}{}{y}{-}{3}{}{z}{,}{0}{\le }{96}{-}{4}{}{x}{-}{4}{}{y}{-}{3}{}{z}\right]$ (1)
 > $L≔\mathrm{Lattice}\left(\mathrm{Matrix}\left(\left[\left[1,0,2\right],\left[0,-1,1\right],\left[0,0,2\right]\right]\right),\mathrm{Vector}\left(\left[0,0,1\right]\right)\right)$
 ${L}{≔}{\mathrm{Lattice}}{}\left(\left[\begin{array}{ccc}{1}& {0}& {2}\\ {0}& {-1}& {1}\\ {0}& {0}& {2}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {0}\\ {1}\end{array}\right]\right)$ (2)
 > $\mathrm{vars}≔\left[z,x,y\right]$
 ${\mathrm{vars}}{≔}\left[{z}{,}{x}{,}{y}\right]$ (3)
 > $\mathrm{zp}≔\mathrm{ZPolyhedralSet}\left(\mathrm{ineqs},\mathrm{vars},\mathrm{lattice}=L\right)$
 ${\mathrm{zp}}{≔}\left\{\begin{array}{lll}{\text{Relations}}& {:}& \left\{\begin{array}{:}{0}{\le }{2}{}{y}{-}{z}\\ {0}{\le }{-}{16}{+}{2}{}{y}{+}{z}\\ {0}{\le }{8}{-}{2}{}{y}{+}{z}\\ {0}{\le }{24}{-}{2}{}{y}{-}{z}\\ {0}{\le }{-}{4}{}{x}{+}{4}{}{y}{+}{3}{}{z}\\ {0}{\le }{-}{72}{+}{4}{}{x}{+}{4}{}{y}{+}{3}{}{z}\\ {0}{\le }{-}{24}{+}{4}{}{x}{-}{4}{}{y}{+}{3}{}{z}\\ {0}{\le }{-}{24}{+}{4}{}{x}{+}{4}{}{y}{-}{3}{}{z}\\ {0}{\le }{24}{+}{4}{}{x}{-}{4}{}{y}{-}{3}{}{z}\\ {0}{\le }{48}{-}{4}{}{x}{-}{4}{}{y}{+}{3}{}{z}\\ {0}{\le }{48}{-}{4}{}{x}{+}{4}{}{y}{-}{3}{}{z}\\ {0}{\le }{96}{-}{4}{}{x}{-}{4}{}{y}{-}{3}{}{z}\end{array}\right\\\ {\text{Variables}}& {:}& \left[{z}{,}{x}{,}{y}\right]\\ {\text{Parameters}}& {:}& \left[\right]\\ {\text{ParameterConstraints}}& {:}& \left\{\begin{array}{}\end{array}\right\\\ {\text{Lattice}}& {:}& {\text{ZSpan}}\left(\left[\begin{array}{ccc}{1}& {0}& {2}\\ {0}& {-1}& {1}\\ {0}& {0}& {2}\end{array}\right]{,}{,}{,}\left[\begin{array}{c}{0}\\ {0}\\ {1}\end{array}\right]\right)\end{array}\right\$ (4)

Get a sample point from zp

 > $\mathrm{Point_from_pzp}≔\mathrm{SamplePoint}\left(\mathrm{zp}\right)$
 ${\mathrm{Point_from_pzp}}{≔}\left[{z}{=}{10}{,}{x}{=}{9}{,}{y}{=}{7}\right]$ (5)

Turn it into Vector form

 > $\mathrm{vect}≔\mathrm{Vector}\left(\left[\mathrm{seq}\left(\mathrm{rhs}\left(\mathrm{pt}\right),\mathrm{pt}=\mathrm{Point_from_pzp}\right)\right]\right)$
 ${\mathrm{vect}}{≔}\left[\begin{array}{c}{10}\\ {9}\\ {7}\end{array}\right]$ (6)

Check that it indeed belongs to zp

 > $\mathrm{IsIntegerPointOf}\left(\mathrm{zp},\mathrm{vect}\right)$
 ${\mathrm{true}}$ (7)

Pick a random integer point

 > $\mathrm{vect}≔\mathrm{Vector}\left(\left[0,0,0\right]\right)$
 ${\mathrm{vect}}{≔}\left[\begin{array}{c}{0}\\ {0}\\ {0}\end{array}\right]$ (8)

Check whether it belongs to zp

 > $\mathrm{IsIntegerPointOf}\left(\mathrm{zp},\mathrm{vect}\right)$
 ${\mathrm{false}}$ (9)

Double-check that latter answer by enumerating the points of zp

 > $\mathrm{EnumerateIntegerPoints}\left(\mathrm{zp}\right)$
 $\left[\left[{x}{=}{9}{,}{y}{=}{5}{,}{z}{=}{6}\right]{,}\left[{x}{=}{9}{,}{y}{=}{7}{,}{z}{=}{6}\right]{,}\left[{x}{=}{8}{,}{y}{=}{5}{,}{z}{=}{7}\right]{,}\left[{x}{=}{9}{,}{y}{=}{5}{,}{z}{=}{7}\right]{,}\left[{x}{=}{10}{,}{y}{=}{5}{,}{z}{=}{7}\right]{,}\left[{x}{=}{8}{,}{y}{=}{7}{,}{z}{=}{7}\right]{,}\left[{x}{=}{9}{,}{y}{=}{7}{,}{z}{=}{7}\right]{,}\left[{x}{=}{10}{,}{y}{=}{7}{,}{z}{=}{7}\right]{,}\left[{x}{=}{7}{,}{y}{=}{5}{,}{z}{=}{8}\right]{,}\left[{x}{=}{8}{,}{y}{=}{5}{,}{z}{=}{8}\right]{,}\left[{x}{=}{9}{,}{y}{=}{5}{,}{z}{=}{8}\right]{,}\left[{x}{=}{10}{,}{y}{=}{5}{,}{z}{=}{8}\right]{,}\left[{x}{=}{11}{,}{y}{=}{5}{,}{z}{=}{8}\right]{,}\left[{x}{=}{7}{,}{y}{=}{7}{,}{z}{=}{8}\right]{,}\left[{x}{=}{8}{,}{y}{=}{7}{,}{z}{=}{8}\right]{,}\left[{x}{=}{9}{,}{y}{=}{7}{,}{z}{=}{8}\right]{,}\left[{x}{=}{10}{,}{y}{=}{7}{,}{z}{=}{8}\right]{,}\left[{x}{=}{11}{,}{y}{=}{7}{,}{z}{=}{8}\right]{,}\left[{x}{=}{8}{,}{y}{=}{5}{,}{z}{=}{9}\right]{,}\left[{x}{=}{9}{,}{y}{=}{5}{,}{z}{=}{9}\right]{,}\left[{x}{=}{10}{,}{y}{=}{5}{,}{z}{=}{9}\right]{,}\left[{x}{=}{8}{,}{y}{=}{7}{,}{z}{=}{9}\right]{,}\left[{x}{=}{9}{,}{y}{=}{7}{,}{z}{=}{9}\right]{,}\left[{x}{=}{10}{,}{y}{=}{7}{,}{z}{=}{9}\right]{,}\left[{x}{=}{9}{,}{y}{=}{5}{,}{z}{=}{10}\right]{,}\left[{x}{=}{9}{,}{y}{=}{7}{,}{z}{=}{10}\right]\right]$ (10)

References

 Rachid Seghir, Vincent Loechner, and Benoı̂t Meister. "Integer affine transformations of parametric Z-polytopes and applications to loop nest optimization." Proceedings of TACO, Vol. 9(2):8:1–8:27, 2012.
 Rui-Juan Jing and Marc Moreno Maza. "Computing the Integer Points of a Polyhedron, I: Algorithm." Proceedings of CASC 2017: 225-241, Springer.
 Rui-Juan Jing and Marc Moreno Maza. "Computing the Integer Points of a Polyhedron, II: Complexity Estimates." Proceedings of CASC 2017: 242-256, Springer.

Compatibility

 • The PolyhedralSets:-ZPolyhedralSets:-IsIntegerPointOf command was introduced in Maple 2023.