update pet for explicitly linking in gmp
[barvinok.git] / polysign_cdd.cc
blobdc529fdf8ee4b4981a0c469bd96ed54a79345036
1 #define DD_LPType dd_LPType
2 #define DD_CreateLPData dd_CreateLPData
3 #define DD_LPObjectiveType dd_LPObjectiveType
4 #define DD_rowrange dd_rowrange
5 #define DD_colrange dd_colrange
6 #define DD_Rational dd_Rational
7 #define DD_FALSE dd_FALSE
8 #define DD_set_si dd_set_si
9 #define DD_neg dd_neg
10 #define DD_ErrorType dd_ErrorType
11 #define DD_DualSimplex dd_DualSimplex
12 #define DD_LPSolve dd_LPSolve
13 #define DD_NoError dd_NoError
14 #define DD_Optimal dd_Optimal
15 #define DD_DualInconsistent dd_DualInconsistent
16 #define DD_LPmin dd_LPmin
17 #define DD_Inconsistent dd_Inconsistent
18 #define DD_FreeLPData dd_FreeLPData
19 #define DD_LPmax dd_LPmax
20 #define DD_int_sign(sign,obj,val) \
21 do { \
22 if (obj == DD_LPmin) { \
23 if (mpq_sgn(val) > 0) \
24 sign = 1; \
25 else if (mpz_cmpabs(mpq_numref(val), mpq_denref(val)) < 0) \
26 sign = 0; \
27 else \
28 sign = -1; \
29 } else { \
30 if (mpz_cmp(mpq_numref(val), mpq_denref(val)) >= 0) \
31 sign = 1; \
32 else if (mpq_sgn(val) >= 0) \
33 sign = 0; \
34 else \
35 sign = -1; \
36 } \
37 } while (0)
38 #define DD_rat_sign(sign,obj,val) sign = dd_sgn(val)
40 #define DD_set_z(a,b) mpq_set_z(a,b)
41 #define DD_floor(a,b) mpz_fdiv_q(a,mpq_numref(b),mpq_denref(b))
42 #define DD_ceil(a,b) mpz_cdiv_q(a,mpq_numref(b),mpq_denref(b))
44 #include "polysign_cdd_template.cc"