PolyhedralSets[ZPolyhedralSets]
Lattice
construct an integer lattice
Calling Sequence
Parameters
Description
Examples
References
Compatibility
Lattice(matrix, vector)
Lattice(lattice)
matrix
-
a matrix with only integer entries
vector
a vector with only integer entries
lattice
lattice to copy
Lattice(matrix, vector) returns the integer lattice generated by matrix and vector. The lattice generated by matrix and vector is the set of all integer points obtained by multiplying matrix on the right by an integer vector and adding vector to that product.
The number of rows of matrix must match the number of entries of vector. Otherwise, an error is raised.
In some literature, a lattice of the d-dimensional Euclidean space consists of all linear combinations with integer coefficients of a basis of that space. In some other literature, see the reference below, the notion of a lattice precisely matches that of this command.
By default, matrix and vector are copied after creating the lattice.
with⁡PolyhedralSets:
with⁡ZPolyhedralSets:
with⁡plots:
with⁡LinearAlgebra:
Create the two-dimensional integer lattice, that is, all couples of integers
L≔Lattice⁡Matrix⁡1,0,0,1,Vector⁡0,0
L≔Lattice⁡1001,00
Plot the two-dimensional integer lattice
plots:-pointplot⁡seq⁡seq⁡x,y,x=−5..5,y=−5..5
Create another two-dimensional lattice,
A≔Matrix⁡2,0,0,−1;V≔Vector⁡0,0;L≔Lattice⁡A,V
A≔200−1
V≔00
L≔Lattice⁡200−1,00
Access the data of the lattice
GetMatrix⁡L;GetVector⁡L
200−1
00
Plot this two-dimensional lattice
L≔seq⁡seq⁡VectorAdd⁡MatrixVectorMultiply⁡A,Vector⁡x,y,V,x=−5..5,y=−5..5
L≔−105,−85,−65,−45,−25,05,25,45,65,85,105,−104,−84,−64,−44,−24,04,24,44,64,84,104,−103,−83,−63,−43,−23,03,23,43,63,83,103,−102,−82,−62,−42,−22,02,22,42,62,82,102,−101,−81,−61,−41,−21,01,21,41,61,81,101,−100,−80,−60,−40,−20,00,20,40,60,80,100,−10−1,−8−1,−6−1,−4−1,−2−1,0−1,2−1,4−1,6−1,8−1,10−1,−10−2,−8−2,−6−2,−4−2,−2−2,0−2,2−2,4−2,6−2,8−2,10−2,−10−3,−8−3,−6−3,−4−3,−2−3,0−3,2−3,4−3,6−3,8−3,10−3,−10−4,−8−4,−6−4,−4−4,−2−4,0−4,2−4,4−4,6−4,8−4,10−4,−10−5,−8−5,−6−5,−4−5,−2−5,0−5,2−5,4−5,6−5,8−5,10−5
plots:-pointplot⁡L,color=blue
Create the three-dimensional integer lattice, that is, all triples of integers
L≔Lattice⁡Matrix⁡1,0,0,0,1,0,0,0,1,Vector⁡0,0,0
L≔Lattice⁡100010001,000
Plot the three-dimensional integer lattice
plots:-pointplot3d⁡seq⁡seq⁡seq⁡x,y,z,x=−5..5,y=−5..5,z=−5..5
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.
The PolyhedralSets:-ZPolyhedralSets:-Lattice package was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
See Also
ZPolyhedralSets
PolyhedralSets
Download Help Document