replace obsolete AC_PROG_LIBTOOL by LT_INIT
[isl.git] / isl_int_imath.h
blobed314b65460de044c5428bc5255d91cfdd01e2ea
1 #ifndef ISL_INT_IMATH_H
2 #define ISL_INT_IMATH_H
4 #include <isl_imath.h>
6 /* isl_int is the basic integer type, implemented with imath's mp_int. */
7 typedef mp_int isl_int;
9 #define isl_int_init(i) i = mp_int_alloc()
10 #define isl_int_clear(i) mp_int_free(i)
12 #define isl_int_set(r,i) impz_set(r,i)
13 #define isl_int_set_si(r,i) impz_set_si(r,i)
14 #define isl_int_set_ui(r,i) impz_set_ui(r,i)
15 #define isl_int_fits_slong(r) isl_imath_fits_slong_p(r)
16 #define isl_int_get_si(r) impz_get_si(r)
17 #define isl_int_fits_ulong(r) isl_imath_fits_ulong_p(r)
18 #define isl_int_get_ui(r) impz_get_ui(r)
19 #define isl_int_get_d(r) impz_get_si(r)
20 #define isl_int_get_str(r) impz_get_str(0, 10, r)
21 #define isl_int_abs(r,i) impz_abs(r,i)
22 #define isl_int_neg(r,i) impz_neg(r,i)
23 #define isl_int_swap(i,j) impz_swap(i,j)
24 #define isl_int_swap_or_set(i,j) impz_swap(i,j)
25 #define isl_int_add_ui(r,i,j) impz_add_ui(r,i,j)
26 #define isl_int_sub_ui(r,i,j) impz_sub_ui(r,i,j)
28 #define isl_int_add(r,i,j) impz_add(r,i,j)
29 #define isl_int_sub(r,i,j) impz_sub(r,i,j)
30 #define isl_int_mul(r,i,j) impz_mul(r,i,j)
31 #define isl_int_mul_2exp(r,i,j) impz_mul_2exp(r,i,j)
32 #define isl_int_mul_si(r,i,j) mp_int_mul_value(i,j,r)
33 #define isl_int_mul_ui(r,i,j) impz_mul_ui(r,i,j)
34 #define isl_int_pow_ui(r,i,j) impz_pow_ui(r,i,j)
35 #define isl_int_addmul(r,i,j) impz_addmul(r,i,j)
36 #define isl_int_addmul_ui(r,i,j) isl_imath_addmul_ui(r,i,j)
37 #define isl_int_submul(r,i,j) impz_submul(r,i,j)
38 #define isl_int_submul_ui(r,i,j) isl_imath_submul_ui(r,i,j)
40 #define isl_int_gcd(r,i,j) impz_gcd(r,i,j)
41 #define isl_int_lcm(r,i,j) impz_lcm(r,i,j)
42 #define isl_int_divexact(r,i,j) impz_divexact(r,i,j)
43 #define isl_int_divexact_ui(r,i,j) impz_divexact_ui(r,i,j)
44 #define isl_int_tdiv_q(r,i,j) impz_tdiv_q(r,i,j)
45 #define isl_int_cdiv_q(r,i,j) impz_cdiv_q(r,i,j)
46 #define isl_int_cdiv_q_ui(r,i,j) isl_imath_cdiv_q_ui(r,i,j)
47 #define isl_int_fdiv_q(r,i,j) impz_fdiv_q(r,i,j)
48 #define isl_int_fdiv_r(r,i,j) impz_fdiv_r(r,i,j)
49 #define isl_int_fdiv_q_ui(r,i,j) isl_imath_fdiv_q_ui(r,i,j)
51 #define isl_int_read(r,s) impz_set_str(r,s,10)
52 #define isl_int_sgn(i) impz_sgn(i)
53 #define isl_int_cmp(i,j) impz_cmp(i,j)
54 #define isl_int_cmp_si(i,si) impz_cmp_si(i,si)
55 #define isl_int_eq(i,j) (impz_cmp(i,j) == 0)
56 #define isl_int_ne(i,j) (impz_cmp(i,j) != 0)
57 #define isl_int_lt(i,j) (impz_cmp(i,j) < 0)
58 #define isl_int_le(i,j) (impz_cmp(i,j) <= 0)
59 #define isl_int_gt(i,j) (impz_cmp(i,j) > 0)
60 #define isl_int_ge(i,j) (impz_cmp(i,j) >= 0)
61 #define isl_int_abs_cmp(i,j) impz_cmpabs(i,j)
62 #define isl_int_abs_eq(i,j) (impz_cmpabs(i,j) == 0)
63 #define isl_int_abs_ne(i,j) (impz_cmpabs(i,j) != 0)
64 #define isl_int_abs_lt(i,j) (impz_cmpabs(i,j) < 0)
65 #define isl_int_abs_gt(i,j) (impz_cmpabs(i,j) > 0)
66 #define isl_int_abs_ge(i,j) (impz_cmpabs(i,j) >= 0)
67 #define isl_int_is_divisible_by(i,j) impz_divisible_p(i,j)
69 uint32_t isl_imath_hash(mp_int v, uint32_t hash);
70 #define isl_int_hash(v,h) isl_imath_hash(v,h)
72 typedef void (*isl_int_print_mp_free_t)(void *, size_t);
73 #define isl_int_free_str(s) free(s)
75 #endif /* ISL_INT_IMATH_H */