1 #ifndef ISL_POLYNOMIAL_H
2 #define ISL_POLYNOMIAL_H
10 #if defined(__cplusplus)
14 struct isl_qpolynomial
;
15 typedef struct isl_qpolynomial isl_qpolynomial
;
17 __isl_give isl_qpolynomial
*isl_qpolynomial_zero(__isl_take isl_dim
*dim
);
18 __isl_give isl_qpolynomial
*isl_qpolynomial_infty(__isl_take isl_dim
*dim
);
19 __isl_give isl_qpolynomial
*isl_qpolynomial_nan(__isl_take isl_dim
*dim
);
20 __isl_give isl_qpolynomial
*isl_qpolynomial_rat_cst(__isl_take isl_dim
*dim
,
21 const isl_int n
, const isl_int d
);
22 __isl_give isl_qpolynomial
*isl_qpolynomial_div(__isl_take isl_div
*div
);
23 __isl_give isl_qpolynomial
*isl_qpolynomial_var(__isl_take isl_dim
*dim
,
24 enum isl_dim_type type
, unsigned pos
);
25 __isl_give isl_qpolynomial
*isl_qpolynomial_copy(__isl_keep isl_qpolynomial
*qp
);
26 void isl_qpolynomial_free(__isl_take isl_qpolynomial
*qp
);
28 int isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial
*qp
,
29 isl_int
*n
, isl_int
*d
);
31 __isl_give isl_qpolynomial
*isl_qpolynomial_neg(__isl_take isl_qpolynomial
*qp
);
32 __isl_give isl_qpolynomial
*isl_qpolynomial_add(__isl_take isl_qpolynomial
*qp1
,
33 __isl_take isl_qpolynomial
*qp2
);
34 __isl_give isl_qpolynomial
*isl_qpolynomial_mul(__isl_take isl_qpolynomial
*qp1
,
35 __isl_take isl_qpolynomial
*qp2
);
38 typedef struct isl_term isl_term
;
40 isl_ctx
*isl_term_get_ctx(__isl_keep isl_term
*term
);
42 void isl_term_free(__isl_take isl_term
*term
);
44 unsigned isl_term_dim(__isl_keep isl_term
*term
, enum isl_dim_type type
);
45 void isl_term_get_num(__isl_keep isl_term
*term
, isl_int
*n
);
46 void isl_term_get_den(__isl_keep isl_term
*term
, isl_int
*d
);
47 int isl_term_get_exp(__isl_keep isl_term
*term
,
48 enum isl_dim_type type
, unsigned pos
);
49 __isl_give isl_div
*isl_term_get_div(__isl_keep isl_term
*term
, unsigned pos
);
51 int isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial
*qp
,
52 int (*fn
)(__isl_take isl_term
*term
, void *user
), void *user
);
54 __isl_give isl_qpolynomial
*isl_qpolynomial_eval(
55 __isl_take isl_qpolynomial
*qp
, __isl_take isl_point
*pnt
);
57 void isl_qpolynomial_print(__isl_keep isl_qpolynomial
*qp
, FILE *out
,
58 unsigned output_format
);
60 struct isl_pw_qpolynomial
;
61 typedef struct isl_pw_qpolynomial isl_pw_qpolynomial
;
63 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_zero(__isl_take isl_dim
*dim
);
64 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_alloc(__isl_take isl_set
*set
,
65 __isl_take isl_qpolynomial
*qp
);
66 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_copy(
67 __isl_keep isl_pw_qpolynomial
*pwqp
);
68 void isl_pw_qpolynomial_free(__isl_take isl_pw_qpolynomial
*pwqp
);
70 __isl_give isl_dim
*isl_pw_qpolynomial_get_dim(
71 __isl_keep isl_pw_qpolynomial
*pwqp
);
72 unsigned isl_pw_qpolynomial_dim(__isl_keep isl_pw_qpolynomial
*pwqp
,
73 enum isl_dim_type type
);
75 __isl_give isl_set
*isl_pw_qpolynomial_domain(__isl_take isl_pw_qpolynomial
*pwqp
);
76 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_intersect_domain(
77 __isl_take isl_pw_qpolynomial
*pwpq
, __isl_take isl_set
*set
);
79 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_add(
80 __isl_take isl_pw_qpolynomial
*pwqp1
,
81 __isl_take isl_pw_qpolynomial
*pwqp2
);
82 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_sub(
83 __isl_take isl_pw_qpolynomial
*pwqp1
,
84 __isl_take isl_pw_qpolynomial
*pwqp2
);
85 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_add_disjoint(
86 __isl_take isl_pw_qpolynomial
*pwqp1
,
87 __isl_take isl_pw_qpolynomial
*pwqp2
);
88 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_neg(
89 __isl_take isl_pw_qpolynomial
*pwqp
);
90 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_mul(
91 __isl_take isl_pw_qpolynomial
*pwqp1
,
92 __isl_take isl_pw_qpolynomial
*pwqp2
);
94 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_move(
95 __isl_take isl_pw_qpolynomial
*pwqp
,
96 enum isl_dim_type dst_type
, unsigned dst_pos
,
97 enum isl_dim_type src_type
, unsigned src_pos
, unsigned n
);
99 __isl_give isl_qpolynomial
*isl_pw_qpolynomial_eval(
100 __isl_take isl_pw_qpolynomial
*pwqp
, __isl_take isl_point
*pnt
);
102 int isl_pw_qpolynomial_foreach_piece(__isl_keep isl_pw_qpolynomial
*pwqp
,
103 int (*fn
)(__isl_take isl_set
*set
, __isl_take isl_qpolynomial
*qp
,
104 void *user
), void *user
);
105 int isl_pw_qpolynomial_foreach_lifted_piece(__isl_keep isl_pw_qpolynomial
*pwqp
,
106 int (*fn
)(__isl_take isl_set
*set
, __isl_take isl_qpolynomial
*qp
,
107 void *user
), void *user
);
109 void isl_pw_qpolynomial_print(__isl_keep isl_pw_qpolynomial
*pwqp
, FILE *out
,
110 unsigned output_format
);
118 struct isl_qpolynomial_fold
;
119 typedef struct isl_qpolynomial_fold isl_qpolynomial_fold
;
121 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_empty(enum isl_fold type
,
122 __isl_take isl_dim
*dim
);
123 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_alloc(
124 enum isl_fold type
, __isl_take isl_qpolynomial
*qp
);
125 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_copy(
126 __isl_keep isl_qpolynomial_fold
*fold
);
127 void isl_qpolynomial_fold_free(__isl_take isl_qpolynomial_fold
*fold
);
129 int isl_qpolynomial_fold_is_empty(__isl_keep isl_qpolynomial_fold
*fold
);
131 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_fold(
132 __isl_take isl_qpolynomial_fold
*fold1
,
133 __isl_take isl_qpolynomial_fold
*fold2
);
135 __isl_give isl_qpolynomial
*isl_qpolynomial_fold_eval(
136 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_point
*pnt
);
138 void isl_qpolynomial_fold_print(__isl_keep isl_qpolynomial_fold
*fold
, FILE *out
,
139 unsigned output_format
);
141 struct isl_pw_qpolynomial_fold
;
142 typedef struct isl_pw_qpolynomial_fold isl_pw_qpolynomial_fold
;
144 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_from_pw_qpolynomial(
145 enum isl_fold type
, __isl_take isl_pw_qpolynomial
*pwqp
);
147 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_alloc(
148 __isl_take isl_set
*set
, __isl_take isl_qpolynomial_fold
*fold
);
149 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_copy(
150 __isl_keep isl_pw_qpolynomial_fold
*pwf
);
151 void isl_pw_qpolynomial_fold_free(__isl_take isl_pw_qpolynomial_fold
*pwf
);
153 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_zero(
154 __isl_take isl_dim
*dim
);
156 __isl_give isl_set
*isl_pw_qpolynomial_fold_domain(
157 __isl_take isl_pw_qpolynomial_fold
*pwf
);
158 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_intersect_domain(
159 __isl_take isl_pw_qpolynomial_fold
*pwf
, __isl_take isl_set
*set
);
161 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_add(
162 __isl_take isl_pw_qpolynomial_fold
*pwf1
,
163 __isl_take isl_pw_qpolynomial_fold
*pwf2
);
164 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_add_disjoint(
165 __isl_take isl_pw_qpolynomial_fold
*pwf1
,
166 __isl_take isl_pw_qpolynomial_fold
*pwf2
);
168 __isl_give isl_qpolynomial
*isl_pw_qpolynomial_fold_eval(
169 __isl_take isl_pw_qpolynomial_fold
*pwf
, __isl_take isl_point
*pnt
);
171 void isl_pw_qpolynomial_fold_print(__isl_keep isl_pw_qpolynomial_fold
*pwf
,
172 FILE *out
, unsigned output_format
);
174 #if defined(__cplusplus)