X4ti2

4ti2.spad line 150 [edit on github]

X4ti2 provides an interface to the program zsolve from the 4ti2 software package (http://4ti2.de, https://4ti2.github.io/).

clearDenominators: Record(qmat: Matrix Fraction Integer, zrels: Vector Integer, qrhs: Vector Fraction Integer) -> Record(zmat: Matrix Integer, zrels: Vector Integer, zrhs: Vector Integer)

clearDenominators(q) computes (for each row i separately) the common denominator of the entries of row(q.qmat,i) and q.qrhx.i and multiplies the entries by this denominator.

setExecutable: String -> String

setExecutable(path) sets a path for an executable that is called during the zsolve function call. It returns the old path. The default path is "/usr/bin/4ti2-zsolve”.

setOptions: String -> String

setOptions(options) sets a options for an executable that is called during the zsolve function call. It returns the old options. The default option is “-q".

zsolve: (Matrix Integer, Vector Integer, Vector Integer) -> Record(zinhom: List Vector Integer, zhom: List Vector Integer, zfree: List Vector Integer)

If A is a (m,n)-matrix, r an m-dimensional vector with entries from {-1, 0, 1}, b an m-dimensional vector, then zsolve(A, r, b) returns 3 lists I, H, F such that for any vector i in inhom and any NN-linear combination h of vectors from hom H and any ZZ-linear combination f of vectors from F, the vector x=i+h+f solves the given system Ax r b where here the vector r has to be interpreted rowwise, such that -1 means <=, 0 means =, and 1 means >=. The function creates some random files to transmit data to and from 4ti2. These files will be written to the current directory and start with the prefix "4ti2-” followed by a random number. They will be removed after the computation.

zsolve: Record(qmat: Matrix Fraction Integer, zrels: Vector Integer, qrhs: Vector Fraction Integer) -> Record(zinhom: List Vector Integer, zhom: List Vector Integer, zfree: List Vector Integer)

zsolve(q) returns zsolve(clearDenominators(q)).

zsolve: Record(zmat: Matrix Integer, zrels: Vector Integer, zrhs: Vector Integer) -> Record(zinhom: List Vector Integer, zhom: List Vector Integer, zfree: List Vector Integer)

zsolve(z) returns zsolve(z.zmat, z.zrels, z.zrhs).