Content-type: text/html; charset=UTF-8
Various test programs are available and can be built from the makefile:
% make fixed
Build the programs fixed1, fixed1n, fixed2, fixed2n, fixedmp, fixedgmp that read an integer k and repeatedly square it 6 times.
% make hybrid (% make mp use internal MP arithmetic instead of GMP)
Build the program hybrid (and fixed1, fixed2, fixedgmp) that runs through the three arithmetic packages as needed.
% make coll (% make flint make FLINT arithmetic version)
Reverse search code for building a Collatz tree with largest value maxn in all arithmetic versions.
% make test
Test the arithmetic constants used in overflow checking.
lrs_mp_init(digits,fpin,fpout);
digits: maximum number of decimal digits in MP arithmetic else set digits=0
fpin, fpout: input and output file pointers, eg, stdin, stdout
lrs_mp a; lrs_mp_vector v; lrs_mp_matrix A;
allocated
lrs_alloc_mp(a); v=lrs_alloc_mp_vector(n); A=lrs_alloc_mp_matrix(m,n);
and freed
lrs_clear_mp(a); lrs_clear_mp_vector(n); lrs_clear_mp_matrix(m,n);
where m and n are the dimensions.
addint(a,b,c) (c=a+b) /* a and b should be different */
changesign(a) (a = -a)
compare(a,b) (a ? b and returns -1,0,1 for <,=,>)
copy(a,b) (a=b)
decint(a,b) (a=a-b)
divint(a,b,c) (c=a/b a=a%b)
exactdivint(a,b,c) (c=a/b)
itomp(i,a); (a=i)
linint(a, ka, b, kb) (a=a*ka+b*kb for ka, kb long long integers)
mp_greater(a, b) (a>b)
mulint(a,b,c) (c=a*b) /* b and c may be the same */
negative(a) (a<0)
one(a) (a == 1)
pmp("string",a) (print "string" followed by a to lrs_ofp)
positive(a) (a>0)
qpiv(a,b,c,d,e) (a=(a*b-c*d)/e where the division is exact )
sign(a) (a < 0 ? NEG : POS)
storesign(a, i) (a = labs(a) * i)
subint(a,b,c) (c=a-b)
zero(a) (a == 0)
User's guide for lrslib