add isl_qpolynomial_neginfty
[isl.git] / isl_polynomial_private.h
blobbe5abe9e0cb58d7bf044d303c812423a016cb532
1 #include <stdio.h>
2 #include <isl_div.h>
3 #include <isl_map.h>
4 #include <isl_mat.h>
5 #include <isl_polynomial.h>
7 struct isl_upoly {
8 int ref;
9 struct isl_ctx *ctx;
11 int var;
14 struct isl_upoly_cst {
15 struct isl_upoly up;
16 isl_int n;
17 isl_int d;
20 struct isl_upoly_rec {
21 struct isl_upoly up;
22 int n;
24 size_t size;
25 struct isl_upoly *p[1];
28 struct isl_qpolynomial {
29 int ref;
31 struct isl_dim *dim;
32 struct isl_mat *div;
33 struct isl_upoly *upoly;
36 struct isl_term {
37 int ref;
39 isl_int n;
40 isl_int d;
42 struct isl_dim *dim;
43 struct isl_mat *div;
45 int pow[1];
48 struct isl_pw_qpolynomial_piece {
49 struct isl_set *set;
50 struct isl_qpolynomial *qp;
53 struct isl_pw_qpolynomial {
54 int ref;
56 struct isl_dim *dim;
58 int n;
60 size_t size;
61 struct isl_pw_qpolynomial_piece p[1];
64 struct isl_qpolynomial_fold {
65 int ref;
67 enum isl_fold type;
68 struct isl_dim *dim;
70 int n;
72 size_t size;
73 struct isl_qpolynomial *qp[1];
76 struct isl_pw_qpolynomial_fold_piece {
77 struct isl_set *set;
78 struct isl_qpolynomial_fold *fold;
81 struct isl_pw_qpolynomial_fold {
82 int ref;
84 struct isl_dim *dim;
86 int n;
88 size_t size;
89 struct isl_pw_qpolynomial_fold_piece p[1];
92 __isl_give struct isl_upoly *isl_upoly_zero(struct isl_ctx *ctx);
93 __isl_give struct isl_upoly *isl_upoly_copy(__isl_keep struct isl_upoly *up);
94 __isl_give struct isl_upoly *isl_upoly_cow(__isl_take struct isl_upoly *up);
95 __isl_give struct isl_upoly *isl_upoly_dup(__isl_keep struct isl_upoly *up);
96 void isl_upoly_free(__isl_take struct isl_upoly *up);
97 __isl_give struct isl_upoly *isl_upoly_mul(__isl_take struct isl_upoly *up1,
98 __isl_take struct isl_upoly *up2);
100 int isl_upoly_is_cst(__isl_keep struct isl_upoly *up);
101 int isl_upoly_is_zero(__isl_keep struct isl_upoly *up);
102 int isl_upoly_is_one(__isl_keep struct isl_upoly *up);
103 int isl_upoly_is_negone(__isl_keep struct isl_upoly *up);
104 __isl_keep struct isl_upoly_cst *isl_upoly_as_cst(__isl_keep struct isl_upoly *up);
105 __isl_keep struct isl_upoly_rec *isl_upoly_as_rec(__isl_keep struct isl_upoly *up);
107 __isl_give struct isl_upoly *isl_upoly_sum(__isl_take struct isl_upoly *up1,
108 __isl_take struct isl_upoly *up2);
109 __isl_give struct isl_upoly *isl_upoly_neg(__isl_take struct isl_upoly *up);
111 __isl_give isl_qpolynomial *isl_qpolynomial_alloc(__isl_take isl_dim *dim,
112 unsigned n_div, __isl_take struct isl_upoly *up);
113 __isl_give isl_qpolynomial *isl_qpolynomial_cow(__isl_take isl_qpolynomial *qp);
114 __isl_give isl_qpolynomial *isl_qpolynomial_dup(__isl_keep isl_qpolynomial *qp);
116 __isl_give isl_qpolynomial *isl_qpolynomial_cst(__isl_take isl_dim *dim,
117 isl_int v);
118 __isl_give isl_qpolynomial *isl_qpolynomial_pow(__isl_take isl_dim *dim,
119 int pos, int power);
120 __isl_give isl_qpolynomial *isl_qpolynomial_div_pow(__isl_take isl_div *div,
121 int power);
122 int isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp);
123 int isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp);
124 int isl_qpolynomial_is_affine(__isl_keep isl_qpolynomial *qp);
126 __isl_give isl_qpolynomial *isl_qpolynomial_max_cst(
127 __isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2);
128 __isl_give isl_qpolynomial *isl_qpolynomial_min_cst(
129 __isl_take isl_qpolynomial *qp1, __isl_take isl_qpolynomial *qp2);
131 __isl_give isl_vec *isl_qpolynomial_extract_affine(
132 __isl_keep isl_qpolynomial *qp);
134 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_cow(
135 __isl_take isl_pw_qpolynomial *pwqp);
137 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_piece(
138 __isl_take isl_pw_qpolynomial *pwqp,
139 __isl_take isl_set *set, __isl_take isl_qpolynomial *qp);
140 int isl_pw_qpolynomial_is_one(__isl_keep isl_pw_qpolynomial *pwqp);
142 __isl_give isl_qpolynomial *isl_qpolynomial_opt_on_domain(
143 __isl_take isl_qpolynomial *qp, __isl_take isl_set *set, int max);
145 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_cow(
146 __isl_take isl_qpolynomial_fold *fold);
147 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_dup(
148 __isl_keep isl_qpolynomial_fold *fold);
150 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_cow(
151 __isl_take isl_pw_qpolynomial_fold *pwf);
153 __isl_give isl_qpolynomial *isl_qpolynomial_fold_opt_on_domain(
154 __isl_take isl_qpolynomial_fold *fold, __isl_take isl_set *set, int max);