Use gmp's gcd rather than PolyLib's
[barvinok.git] / barvinok / polylib.h
blob0513febb3f6a66ba2bda9e194d7540483e48f9fe
1 #ifndef BARVINOK_POLYLIB_H
2 #define BARVINOK_POLYLIB_H
4 #include <gmp.h>
6 #if defined(__cplusplus)
7 extern "C" {
8 #endif
10 #include <polylib/polylibgmp.h>
12 #ifndef value_subtract
13 #define value_subtract value_substract
14 #endif
16 #define value_gcd(ref,val1,val2) mpz_gcd(ref,val1,val2)
17 #define value_lcm(ref,val1,val2) mpz_lcm(ref,val1,val2)
19 #ifndef value_addmul
20 #define value_addmul(ref,val1,val2) \
21 do { \
22 Value _tmp; \
23 value_init(_tmp); \
24 value_multiply(_tmp,val1,val2); \
25 value_addto(ref,ref,_tmp); \
26 value_clear(_tmp); \
27 } while(0)
28 #endif
30 #undef divide
31 #undef value_compare
33 #if defined(__cplusplus)
35 #endif
37 #endif