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