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

# Online Help

###### All Products    Maple    MapleSim

PolyhedralSets[ZPolyhedralSets]

 IsContained
 check whether each integer point of a bounded ZPolyhedralSet is contained in one ZPolyehdralSet from a list

 Calling Sequence IsContained(zpoly,list)

Parameters

 zpoly - ZPolyhedralSet object representing a bounded Z-polyhedral set. list -

Description

 • The IsContained command returns true if every integer point of zpoly is contained in one of the ZPolyhedralSet of the list list, and otherwise it returns false.
 • If zpoly is not bounded, an error is raised.

Examples

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

Create a Z-polyhedron in three-dimensional space.

 > $\mathrm{ineqs}≔\left[3x-2y+z\le 7,-2x+2y-z\le 12,-4x+y+3z\le 15,-y\le -25\right]$
 ${\mathrm{ineqs}}{≔}\left[{3}{}{x}{-}{2}{}{y}{+}{z}{\le }{7}{,}{-}{2}{}{x}{+}{2}{}{y}{-}{z}{\le }{12}{,}{-}{4}{}{x}{+}{y}{+}{3}{}{z}{\le }{15}{,}{-}{y}{\le }{-25}\right]$ (1)
 > $\mathrm{vars}≔\left[x,y,z\right]:$
 > $\mathrm{zp}≔\mathrm{ZPolyhedralSet}\left(\mathrm{ineqs},\mathrm{vars}\right)$

Apply IntegerPointDecomposition to zp.

 > $\mathrm{theset}≔\mathrm{IntegerPointDecomposition}\left(\mathrm{zp}\right)$
 ${\mathrm{theset}}{≔}\left[\left\{\begin{array}{lll}{\text{Relations}}& {:}& \left\{\begin{array}{:}{z}{\le }{17}\\ {-}{y}{\le }{-25}\\ {-}{z}{\le }{-2}\\ {-}{5}{}{y}{+}{13}{}{z}{\le }{67}\\ {2}{}{y}{-}{z}{\le }{48}\\ {-}{4}{}{x}{+}{y}{+}{3}{}{z}{\le }{15}\\ {-}{2}{}{x}{+}{2}{}{y}{-}{z}{\le }{12}\\ {3}{}{x}{-}{2}{}{y}{+}{z}{\le }{7}\end{array}\right\\\ {\text{Variables}}& {:}& \left[{x}{,}{y}{,}{z}\right]\\ {\text{Parameters}}& {:}& \left[\right]\\ {\text{ParameterConstraints}}& {:}& \left\{\begin{array}{}\end{array}\right\\\ {\text{Lattice}}& {:}& {\text{ZSpan}}\left(\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]{,}{,}{,}\left[\begin{array}{c}{0}\\ {0}\\ {0}\end{array}\right]\right)\end{array}\right\{,}\left\{\begin{array}{lll}{\text{Relations}}& {:}& \left\{\begin{array}{:}{x}{=}{15}\\ {y}{=}{27}\\ {z}{=}{16}\end{array}\right\\\ {\text{Variables}}& {:}& \left[{x}{,}{y}{,}{z}\right]\\ {\text{Parameters}}& {:}& \left[\right]\\ {\text{ParameterConstraints}}& {:}& \left\{\begin{array}{}\end{array}\right\\\ {\text{Lattice}}& {:}& {\text{ZSpan}}\left(\left[\begin{array}{c}{7}\\ {13}\\ {5}\end{array}\right]{,}{,}{,}\left[\begin{array}{c}{-6}\\ {-12}\\ {1}\end{array}\right]\right)\end{array}\right\{,}\left\{\begin{array}{lll}{\text{Relations}}& {:}& \left\{\begin{array}{:}{x}{=}{14}\\ {y}{=}{25}\\ {z}{=}{15}\end{array}\right\\\ {\text{Variables}}& {:}& \left[{x}{,}{y}{,}{z}\right]\\ {\text{Parameters}}& {:}& \left[\right]\\ {\text{ParameterConstraints}}& {:}& \left\{\begin{array}{}\end{array}\right\\\ {\text{Lattice}}& {:}& {\text{ZSpan}}\left(\left[\begin{array}{c}{7}\\ {13}\\ {5}\end{array}\right]{,}{,}{,}\left[\begin{array}{c}{-7}\\ {-14}\\ {0}\end{array}\right]\right)\end{array}\right\{,}\left\{\begin{array}{lll}{\text{Relations}}& {:}& \left\{\begin{array}{:}{x}{=}{18}\\ {y}{=}{33}\\ {z}{=}{18}\end{array}\right\\\ {\text{Variables}}& {:}& \left[{x}{,}{y}{,}{z}\right]\\ {\text{Parameters}}& {:}& \left[\right]\\ {\text{ParameterConstraints}}& {:}& \left\{\begin{array}{}\end{array}\right\\\ {\text{Lattice}}& {:}& {\text{ZSpan}}\left(\left[\begin{array}{c}{7}\\ {13}\\ {5}\end{array}\right]{,}{,}{,}\left[\begin{array}{c}{-3}\\ {-6}\\ {3}\end{array}\right]\right)\end{array}\right\{,}\left\{\begin{array}{lll}{\text{Relations}}& {:}& \left\{\begin{array}{:}{x}{=}{19}\\ {y}{=}\frac{{z}}{{2}}{+}{25}\\ {z}{\le }{18}\\ {-}{z}{\le }{0}\end{array}\right\\\ {\text{Variables}}& {:}& \left[{x}{,}{y}{,}{z}\right]\\ {\text{Parameters}}& {:}& \left[\right]\\ {\text{ParameterConstraints}}& {:}& \left\{\begin{array}{}\end{array}\right\\\ {\text{Lattice}}& {:}& {\text{ZSpan}}\left(\left[\begin{array}{c}{0}\\ {1}\\ {2}\end{array}\right]{,}{,}{,}\left[\begin{array}{c}{19}\\ {25}\\ {0}\end{array}\right]\right)\end{array}\right\\right]$ (2)

Create two other Z-polyhedra in three-dimensional space.

 > $\mathrm{ineqs1}≔\left[x=19,y=\frac{z}{2}+25,-z\le 0,z\le 18\right]$
 ${\mathrm{ineqs1}}{≔}\left[{x}{=}{19}{,}{y}{=}\frac{{z}}{{2}}{+}{25}{,}{-}{z}{\le }{0}{,}{z}{\le }{18}\right]$ (3)
 > $\mathrm{ineqs2}≔\left[x=18,y=\frac{z}{2}+25,-z\le 0,z\le 18\right]$
 ${\mathrm{ineqs2}}{≔}\left[{x}{=}{18}{,}{y}{=}\frac{{z}}{{2}}{+}{25}{,}{-}{z}{\le }{0}{,}{z}{\le }{18}\right]$ (4)
 > $\mathrm{zp1}≔\mathrm{ZPolyhedralSet}\left(\mathrm{ineqs1},\mathrm{vars}\right)$
 > $\mathrm{zp2}≔\mathrm{ZPolyhedralSet}\left(\mathrm{ineqs2},\mathrm{vars}\right)$

Check whether each integer point of zp1 is a point of zp.

 > $\mathrm{IsContained}\left(\mathrm{zp1},\mathrm{theset}\right)$
 ${\mathrm{true}}$ (5)

Check whether each integer point of zp2 is a point of zp.

 > $\mathrm{IsContained}\left(\mathrm{zp2},\mathrm{theset}\right)$
 ${\mathrm{false}}$ (6)

Double-check the above inclusion tests by using EnumerateIntegerPoints.

 > $\mathrm{EnumerateIntegerPoints}\left(\mathrm{zp}\right)$
 $\left[\left[{x}{=}{19}{,}{y}{=}{25}{,}{z}{=}{0}\right]{,}\left[{x}{=}{18}{,}{y}{=}{25}{,}{z}{=}{2}\right]{,}\left[{x}{=}{19}{,}{y}{=}{26}{,}{z}{=}{2}\right]{,}\left[{x}{=}{18}{,}{y}{=}{25}{,}{z}{=}{3}\right]{,}\left[{x}{=}{17}{,}{y}{=}{25}{,}{z}{=}{4}\right]{,}\left[{x}{=}{18}{,}{y}{=}{26}{,}{z}{=}{4}\right]{,}\left[{x}{=}{19}{,}{y}{=}{27}{,}{z}{=}{4}\right]{,}\left[{x}{=}{17}{,}{y}{=}{25}{,}{z}{=}{5}\right]{,}\left[{x}{=}{18}{,}{y}{=}{26}{,}{z}{=}{5}\right]{,}\left[{x}{=}{16}{,}{y}{=}{25}{,}{z}{=}{6}\right]{,}\left[{x}{=}{17}{,}{y}{=}{25}{,}{z}{=}{6}\right]{,}\left[{x}{=}{17}{,}{y}{=}{26}{,}{z}{=}{6}\right]{,}\left[{x}{=}{18}{,}{y}{=}{27}{,}{z}{=}{6}\right]{,}\left[{x}{=}{19}{,}{y}{=}{28}{,}{z}{=}{6}\right]{,}\left[{x}{=}{16}{,}{y}{=}{25}{,}{z}{=}{7}\right]{,}\left[{x}{=}{17}{,}{y}{=}{26}{,}{z}{=}{7}\right]{,}\left[{x}{=}{18}{,}{y}{=}{27}{,}{z}{=}{7}\right]{,}\left[{x}{=}{15}{,}{y}{=}{25}{,}{z}{=}{8}\right]{,}\left[{x}{=}{16}{,}{y}{=}{25}{,}{z}{=}{8}\right]{,}\left[{x}{=}{16}{,}{y}{=}{26}{,}{z}{=}{8}\right]{,}\left[{x}{=}{17}{,}{y}{=}{26}{,}{z}{=}{8}\right]{,}\left[{x}{=}{17}{,}{y}{=}{27}{,}{z}{=}{8}\right]{,}\left[{x}{=}{18}{,}{y}{=}{28}{,}{z}{=}{8}\right]{,}\left[{x}{=}{19}{,}{y}{=}{29}{,}{z}{=}{8}\right]{,}\left[{x}{=}{15}{,}{y}{=}{25}{,}{z}{=}{9}\right]{,}\left[{x}{=}{16}{,}{y}{=}{25}{,}{z}{=}{9}\right]{,}\left[{x}{=}{16}{,}{y}{=}{26}{,}{z}{=}{9}\right]{,}\left[{x}{=}{17}{,}{y}{=}{27}{,}{z}{=}{9}\right]{,}\left[{x}{=}{18}{,}{y}{=}{28}{,}{z}{=}{9}\right]{,}\left[{x}{=}{14}{,}{y}{=}{25}{,}{z}{=}{10}\right]{,}\left[{x}{=}{15}{,}{y}{=}{25}{,}{z}{=}{10}\right]{,}\left[{x}{=}{15}{,}{y}{=}{26}{,}{z}{=}{10}\right]{,}\left[{x}{=}{16}{,}{y}{=}{26}{,}{z}{=}{10}\right]{,}\left[{x}{=}{16}{,}{y}{=}{27}{,}{z}{=}{10}\right]{,}\left[{x}{=}{17}{,}{y}{=}{27}{,}{z}{=}{10}\right]{,}\left[{x}{=}{17}{,}{y}{=}{28}{,}{z}{=}{10}\right]{,}\left[{x}{=}{18}{,}{y}{=}{29}{,}{z}{=}{10}\right]{,}\left[{x}{=}{19}{,}{y}{=}{30}{,}{z}{=}{10}\right]{,}\left[{x}{=}{14}{,}{y}{=}{25}{,}{z}{=}{11}\right]{,}\left[{x}{=}{15}{,}{y}{=}{25}{,}{z}{=}{11}\right]{,}\left[{x}{=}{15}{,}{y}{=}{26}{,}{z}{=}{11}\right]{,}\left[{x}{=}{16}{,}{y}{=}{26}{,}{z}{=}{11}\right]{,}\left[{x}{=}{16}{,}{y}{=}{27}{,}{z}{=}{11}\right]{,}\left[{x}{=}{17}{,}{y}{=}{28}{,}{z}{=}{11}\right]{,}\left[{x}{=}{18}{,}{y}{=}{29}{,}{z}{=}{11}\right]{,}\left[{x}{=}{13}{,}{y}{=}{25}{,}{z}{=}{12}\right]{,}\left[{x}{=}{14}{,}{y}{=}{25}{,}{z}{=}{12}\right]{,}\left[{x}{=}{15}{,}{y}{=}{25}{,}{z}{=}{12}\right]{,}\left[{x}{=}{14}{,}{y}{=}{26}{,}{z}{=}{12}\right]{,}\left[{x}{=}{15}{,}{y}{=}{26}{,}{z}{=}{12}\right]{,}\left[{x}{=}{15}{,}{y}{=}{27}{,}{z}{=}{12}\right]{,}\left[{x}{=}{16}{,}{y}{=}{27}{,}{z}{=}{12}\right]{,}\left[{x}{=}{16}{,}{y}{=}{28}{,}{z}{=}{12}\right]{,}\left[{x}{=}{17}{,}{y}{=}{28}{,}{z}{=}{12}\right]{,}\left[{x}{=}{17}{,}{y}{=}{29}{,}{z}{=}{12}\right]{,}\left[{x}{=}{18}{,}{y}{=}{30}{,}{z}{=}{12}\right]{,}\left[{x}{=}{19}{,}{y}{=}{31}{,}{z}{=}{12}\right]{,}\left[{x}{=}{13}{,}{y}{=}{25}{,}{z}{=}{13}\right]{,}\left[{x}{=}{14}{,}{y}{=}{25}{,}{z}{=}{13}\right]{,}\left[{x}{=}{14}{,}{y}{=}{26}{,}{z}{=}{13}\right]{,}\left[{x}{=}{15}{,}{y}{=}{26}{,}{z}{=}{13}\right]{,}\left[{x}{=}{15}{,}{y}{=}{27}{,}{z}{=}{13}\right]{,}\left[{x}{=}{16}{,}{y}{=}{27}{,}{z}{=}{13}\right]{,}\left[{x}{=}{16}{,}{y}{=}{28}{,}{z}{=}{13}\right]{,}\left[{x}{=}{17}{,}{y}{=}{29}{,}{z}{=}{13}\right]{,}\left[{x}{=}{18}{,}{y}{=}{30}{,}{z}{=}{13}\right]{,}\left[{x}{=}{13}{,}{y}{=}{25}{,}{z}{=}{14}\right]{,}\left[{x}{=}{14}{,}{y}{=}{25}{,}{z}{=}{14}\right]{,}\left[{x}{=}{14}{,}{y}{=}{26}{,}{z}{=}{14}\right]{,}\left[{x}{=}{15}{,}{y}{=}{26}{,}{z}{=}{14}\right]{,}\left[{x}{=}{14}{,}{y}{=}{27}{,}{z}{=}{14}\right]{,}\left[{x}{=}{15}{,}{y}{=}{27}{,}{z}{=}{14}\right]{,}\left[{x}{=}{15}{,}{y}{=}{28}{,}{z}{=}{14}\right]{,}\left[{x}{=}{16}{,}{y}{=}{28}{,}{z}{=}{14}\right]{,}\left[{x}{=}{16}{,}{y}{=}{29}{,}{z}{=}{14}\right]{,}\left[{x}{=}{17}{,}{y}{=}{29}{,}{z}{=}{14}\right]{,}\left[{x}{=}{17}{,}{y}{=}{30}{,}{z}{=}{14}\right]{,}\left[{x}{=}{18}{,}{y}{=}{31}{,}{z}{=}{14}\right]{,}\left[{x}{=}{19}{,}{y}{=}{32}{,}{z}{=}{14}\right]{,}\left[{x}{=}{14}{,}{y}{=}{25}{,}{z}{=}{15}\right]{,}\left[{x}{=}{14}{,}{y}{=}{26}{,}{z}{=}{15}\right]{,}\left[{x}{=}{15}{,}{y}{=}{27}{,}{z}{=}{15}\right]{,}\left[{x}{=}{15}{,}{y}{=}{28}{,}{z}{=}{15}\right]{,}\left[{x}{=}{16}{,}{y}{=}{28}{,}{z}{=}{15}\right]{,}\left[{x}{=}{16}{,}{y}{=}{29}{,}{z}{=}{15}\right]{,}\left[{x}{=}{17}{,}{y}{=}{30}{,}{z}{=}{15}\right]{,}\left[{x}{=}{18}{,}{y}{=}{31}{,}{z}{=}{15}\right]{,}\left[{x}{=}{15}{,}{y}{=}{27}{,}{z}{=}{16}\right]{,}\left[{x}{=}{16}{,}{y}{=}{29}{,}{z}{=}{16}\right]{,}\left[{x}{=}{16}{,}{y}{=}{30}{,}{z}{=}{16}\right]{,}\left[{x}{=}{17}{,}{y}{=}{30}{,}{z}{=}{16}\right]{,}\left[{x}{=}{17}{,}{y}{=}{31}{,}{z}{=}{16}\right]{,}\left[{x}{=}{18}{,}{y}{=}{32}{,}{z}{=}{16}\right]{,}\left[{x}{=}{19}{,}{y}{=}{33}{,}{z}{=}{16}\right]{,}\left[{x}{=}{17}{,}{y}{=}{31}{,}{z}{=}{17}\right]{,}\left[{x}{=}{18}{,}{y}{=}{32}{,}{z}{=}{17}\right]{,}\left[{x}{=}{18}{,}{y}{=}{33}{,}{z}{=}{18}\right]{,}\left[{x}{=}{19}{,}{y}{=}{34}{,}{z}{=}{18}\right]\right]$ (7)
 > $\mathrm{EnumerateIntegerPoints}\left(\mathrm{zp1}\right)$
 $\left[\left[{x}{=}{19}{,}{y}{=}{25}{,}{z}{=}{0}\right]{,}\left[{x}{=}{19}{,}{y}{=}{26}{,}{z}{=}{2}\right]{,}\left[{x}{=}{19}{,}{y}{=}{27}{,}{z}{=}{4}\right]{,}\left[{x}{=}{19}{,}{y}{=}{28}{,}{z}{=}{6}\right]{,}\left[{x}{=}{19}{,}{y}{=}{29}{,}{z}{=}{8}\right]{,}\left[{x}{=}{19}{,}{y}{=}{30}{,}{z}{=}{10}\right]{,}\left[{x}{=}{19}{,}{y}{=}{31}{,}{z}{=}{12}\right]{,}\left[{x}{=}{19}{,}{y}{=}{32}{,}{z}{=}{14}\right]{,}\left[{x}{=}{19}{,}{y}{=}{33}{,}{z}{=}{16}\right]{,}\left[{x}{=}{19}{,}{y}{=}{34}{,}{z}{=}{18}\right]\right]$ (8)
 > $\mathrm{EnumerateIntegerPoints}\left(\mathrm{zp2}\right)$
 $\left[\left[{x}{=}{18}{,}{y}{=}{25}{,}{z}{=}{0}\right]{,}\left[{x}{=}{18}{,}{y}{=}{26}{,}{z}{=}{2}\right]{,}\left[{x}{=}{18}{,}{y}{=}{27}{,}{z}{=}{4}\right]{,}\left[{x}{=}{18}{,}{y}{=}{28}{,}{z}{=}{6}\right]{,}\left[{x}{=}{18}{,}{y}{=}{29}{,}{z}{=}{8}\right]{,}\left[{x}{=}{18}{,}{y}{=}{30}{,}{z}{=}{10}\right]{,}\left[{x}{=}{18}{,}{y}{=}{31}{,}{z}{=}{12}\right]{,}\left[{x}{=}{18}{,}{y}{=}{32}{,}{z}{=}{14}\right]{,}\left[{x}{=}{18}{,}{y}{=}{33}{,}{z}{=}{16}\right]{,}\left[{x}{=}{18}{,}{y}{=}{34}{,}{z}{=}{18}\right]\right]$ (9)

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:-IsContained command was introduced in Maple 2023.
 • For more information on Maple 2023 changes, see Updates in Maple 2023.