isl_coalesce.c: add_subs: return isl_stat
[isl.git] / isl_aff_private.h
blob6ef3d4a39e7c18ba5c810e6a6d48a32edf8aaedf
1 #ifndef ISL_AFF_PRIVATE_H
2 #define ISL_AFF_PRIVATE_H
4 #include <isl/aff.h>
5 #include <isl/vec.h>
6 #include <isl/mat.h>
7 #include <isl/local_space.h>
8 #include <isl_int.h>
9 #include <isl_reordering.h>
11 /* ls represents the domain space.
13 * If the first two elements of "v" (the denominator and the constant term)
14 * are zero, then the isl_aff represents NaN.
16 struct isl_aff {
17 int ref;
19 isl_local_space *ls;
20 isl_vec *v;
23 #undef EL
24 #define EL isl_aff
26 #include <isl_list_templ.h>
28 struct isl_pw_aff_piece {
29 struct isl_set *set;
30 struct isl_aff *aff;
33 struct isl_pw_aff {
34 int ref;
36 isl_space *dim;
38 int n;
40 size_t size;
41 struct isl_pw_aff_piece p[1];
44 #undef PW
45 #define PW isl_pw_aff
47 #include <isl_pw_templ.h>
49 #undef EL
50 #define EL isl_pw_aff
52 #include <isl_list_templ.h>
54 struct isl_pw_multi_aff_piece {
55 isl_set *set;
56 isl_multi_aff *maff;
59 struct isl_pw_multi_aff {
60 int ref;
62 isl_space *dim;
64 int n;
66 size_t size;
67 struct isl_pw_multi_aff_piece p[1];
70 #undef PW
71 #define PW isl_pw_multi_aff
73 #include <isl_pw_templ.h>
75 __isl_give isl_aff *isl_aff_alloc_vec(__isl_take isl_local_space *ls,
76 __isl_take isl_vec *v);
77 __isl_give isl_aff *isl_aff_alloc(__isl_take isl_local_space *ls);
79 __isl_give isl_aff *isl_aff_reset_space_and_domain(__isl_take isl_aff *aff,
80 __isl_take isl_space *space, __isl_take isl_space *domain);
81 __isl_give isl_aff *isl_aff_reset_domain_space(__isl_take isl_aff *aff,
82 __isl_take isl_space *dim);
83 __isl_give isl_aff *isl_aff_realign_domain(__isl_take isl_aff *aff,
84 __isl_take isl_reordering *r);
86 __isl_give isl_aff *isl_aff_set_constant(__isl_take isl_aff *aff, isl_int v);
87 __isl_give isl_aff *isl_aff_set_coefficient(__isl_take isl_aff *aff,
88 enum isl_dim_type type, int pos, isl_int v);
89 __isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v);
91 __isl_give isl_aff *isl_aff_domain_factor_domain(__isl_take isl_aff *aff);
93 int isl_aff_plain_cmp(__isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2);
95 __isl_give isl_aff *isl_aff_remove_unused_divs(__isl_take isl_aff *aff);
96 __isl_give isl_aff *isl_aff_normalize(__isl_take isl_aff *aff);
98 __isl_give isl_aff *isl_aff_expand_divs( __isl_take isl_aff *aff,
99 __isl_take isl_mat *div, int *exp);
101 __isl_give isl_pw_aff *isl_pw_aff_alloc_size(__isl_take isl_space *space,
102 int n);
103 __isl_give isl_pw_aff *isl_pw_aff_reset_space(__isl_take isl_pw_aff *pwaff,
104 __isl_take isl_space *dim);
105 __isl_give isl_pw_aff *isl_pw_aff_reset_domain_space(
106 __isl_take isl_pw_aff *pwaff, __isl_take isl_space *space);
107 __isl_give isl_pw_aff *isl_pw_aff_add_disjoint(
108 __isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2);
110 __isl_give isl_pw_aff *isl_pw_aff_union_opt(__isl_take isl_pw_aff *pwaff1,
111 __isl_take isl_pw_aff *pwaff2, int max);
113 __isl_give isl_pw_aff *isl_pw_aff_set_rational(__isl_take isl_pw_aff *pwaff);
114 __isl_give isl_pw_aff_list *isl_pw_aff_list_set_rational(
115 __isl_take isl_pw_aff_list *list);
117 __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f);
118 __isl_give isl_pw_aff *isl_pw_aff_scale(__isl_take isl_pw_aff *pwaff,
119 isl_int f);
120 __isl_give isl_pw_aff *isl_pw_aff_scale_down(__isl_take isl_pw_aff *pwaff,
121 isl_int f);
123 isl_bool isl_aff_matching_params(__isl_keep isl_aff *aff,
124 __isl_keep isl_space *space);
125 isl_stat isl_aff_check_match_domain_space(__isl_keep isl_aff *aff,
126 __isl_keep isl_space *space);
128 #undef BASE
129 #define BASE aff
131 #include <isl_multi_templ.h>
133 __isl_give isl_multi_aff *isl_multi_aff_dup(__isl_keep isl_multi_aff *multi);
135 __isl_give isl_multi_aff *isl_multi_aff_align_divs(
136 __isl_take isl_multi_aff *maff);
138 __isl_give isl_multi_aff *isl_multi_aff_from_basic_set_equalities(
139 __isl_take isl_basic_set *bset);
141 __isl_give isl_multi_aff *isl_multi_aff_from_aff_mat(
142 __isl_take isl_space *space, __isl_take isl_mat *mat);
144 #undef EL
145 #define EL isl_pw_multi_aff
147 #include <isl_list_templ.h>
149 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_domain_space(
150 __isl_take isl_pw_multi_aff *pwmaff, __isl_take isl_space *space);
151 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_space(
152 __isl_take isl_pw_multi_aff *pwmaff, __isl_take isl_space *space);
153 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_add_disjoint(
154 __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2);
156 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_project_out(
157 __isl_take isl_pw_multi_aff *pma,
158 enum isl_dim_type type, unsigned first, unsigned n);
160 void isl_seq_preimage(isl_int *dst, isl_int *src,
161 __isl_keep isl_multi_aff *ma, int n_before, int n_after,
162 int n_div_ma, int n_div_bmap,
163 isl_int f, isl_int c1, isl_int c2, isl_int g, int has_denom);
165 __isl_give isl_aff *isl_aff_substitute_equalities(__isl_take isl_aff *aff,
166 __isl_take isl_basic_set *eq);
167 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_substitute(
168 __isl_take isl_pw_multi_aff *pma, enum isl_dim_type type, unsigned pos,
169 __isl_keep isl_pw_aff *subs);
171 isl_stat isl_pw_aff_check_named_params(__isl_keep isl_pw_aff *pa);
172 isl_stat isl_pw_multi_aff_check_named_params(__isl_keep isl_pw_multi_aff *pma);
174 isl_bool isl_pw_aff_matching_params(__isl_keep isl_pw_aff *pa,
175 __isl_keep isl_space *space);
176 isl_stat isl_pw_aff_check_match_domain_space(__isl_keep isl_pw_aff *pa,
177 __isl_keep isl_space *space);
179 __isl_give isl_basic_set *isl_aff_pos_basic_set(__isl_take isl_aff *aff);
181 #undef BASE
182 #define BASE pw_aff
183 #undef DOMBASE
184 #define DOMBASE set
185 #define EXPLICIT_DOMAIN
187 #include <isl_multi_templ.h>
189 #undef EXPLICIT_DOMAIN
191 #undef EL
192 #define EL isl_union_pw_aff
194 #include <isl_list_templ.h>
196 #undef BASE
197 #define BASE union_pw_aff
198 #undef DOMBASE
199 #define DOMBASE union_set
200 #define EXPLICIT_DOMAIN
202 #include <isl_multi_templ.h>
204 #undef EXPLICIT_DOMAIN
206 #undef EL
207 #define EL isl_union_pw_multi_aff
209 #include <isl_list_templ.h>
211 #endif