X4ti2¶
4ti2.spad line 151 [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, qsgn: List Integer) -> Record(zmat: Matrix Integer, zrels: Vector Integer, zrhs: Vector Integer, zsgn: List Integer)
clearDenominators(q)computes (for each rowiseparately) the common denominator of the entries of row(q.qmat,i) andq.qrhs.iand multiplies the entries by this denominator.
- setExecutable: String -> String
setExecutable(path)sets apathfor an executable that is called during the zsolve function call. It returns the oldpath. The defaultpathis"/usr/bin/4ti2-zsolve”.
- setOptions: String -> String
setOptions(options)sets aoptionsfor an executable that is called during the zsolve function call. It returns the oldoptions. The default option is “-q".
- zsolve: (Matrix Integer, Vector Integer) -> Record(zinhom: List Vector Integer, zhom: List Vector Integer, zfree: List Vector Integer)
zsolve(A,b)returns zsolve(A,new(\#b,0)$Vector(Integer),b,[]), i.e. it solves the diophantine system A*x=b forx.
- zsolve: (Matrix Integer, Vector Integer, Vector Integer) -> Record(zinhom: List Vector Integer, zhom: List Vector Integer, zfree: List Vector Integer)
zsolve(A,r,b)returns zsolve(A,r,b,[]).
- zsolve: (Matrix Integer, Vector Integer, Vector Integer, List Integer) -> Record(zinhom: List Vector Integer, zhom: List Vector Integer, zfree: List Vector Integer)
If A is a (
m,n)-matrix,ranm-dimensional vector with entries from {-1, 0, 1},banm-dimensional vector, then zsolve(A,r,b,sgn) returns 3 listsI,H,Fsuch that for any vectoriin inhom and anyNN-linear combinationhof vectors from homHand anyZZ-linear combinationfof vectors fromF, the vector x=i+h+f solves the given system Axrbwhere here the vectorrhas to be interpreted rowwise, such that-1means<=, 0 means =, and 1 means>=. If the listsgnis non-empty, it specifies (according to the 4ti2 manual) the entries of the .sign file, i.e. the list must be as long as the number of columns of A. 0 means no restriction forxi, 1 means non-negative. 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.