isl_map_simplify.c: better_div_constraint: use isl_basic_map_dim
[isl.git] / isl_aff_private.h
blob208b3f2779f7c632b4dc2a9ac22e9703d17d2687
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>
10 #include <isl/stream.h>
12 /* ls represents the domain space.
14 * If the first two elements of "v" (the denominator and the constant term)
15 * are zero, then the isl_aff represents NaN.
17 struct isl_aff {
18 int ref;
20 isl_local_space *ls;
21 isl_vec *v;
24 #undef EL
25 #define EL isl_aff
27 #include <isl_list_templ.h>
29 struct isl_pw_aff_piece {
30 struct isl_set *set;
31 struct isl_aff *aff;
34 struct isl_pw_aff {
35 int ref;
37 isl_space *dim;
39 int n;
41 size_t size;
42 struct isl_pw_aff_piece p[1];
45 #undef PW
46 #define PW isl_pw_aff
48 #include <isl_pw_templ.h>
50 #undef EL
51 #define EL isl_pw_aff
53 #include <isl_list_templ.h>
55 struct isl_pw_multi_aff_piece {
56 isl_set *set;
57 isl_multi_aff *maff;
60 struct isl_pw_multi_aff {
61 int ref;
63 isl_space *dim;
65 int n;
67 size_t size;
68 struct isl_pw_multi_aff_piece p[1];
71 #undef PW
72 #define PW isl_pw_multi_aff
74 #include <isl_pw_templ.h>
76 __isl_give isl_aff *isl_aff_alloc_vec(__isl_take isl_local_space *ls,
77 __isl_take isl_vec *v);
78 __isl_give isl_aff *isl_aff_alloc(__isl_take isl_local_space *ls);
80 isl_size isl_aff_domain_dim(__isl_keep isl_aff *aff, enum isl_dim_type type);
81 isl_size isl_aff_domain_offset(__isl_keep isl_aff *aff, enum isl_dim_type type);
83 __isl_give isl_aff *isl_aff_reset_space_and_domain(__isl_take isl_aff *aff,
84 __isl_take isl_space *space, __isl_take isl_space *domain);
85 __isl_give isl_aff *isl_aff_reset_domain_space(__isl_take isl_aff *aff,
86 __isl_take isl_space *space);
87 __isl_give isl_aff *isl_aff_realign_domain(__isl_take isl_aff *aff,
88 __isl_take isl_reordering *r);
90 __isl_give isl_aff *isl_aff_set_constant(__isl_take isl_aff *aff, isl_int v);
91 __isl_give isl_aff *isl_aff_set_coefficient(__isl_take isl_aff *aff,
92 enum isl_dim_type type, int pos, isl_int v);
93 __isl_give isl_aff *isl_aff_add_constant(__isl_take isl_aff *aff, isl_int v);
95 __isl_give isl_aff *isl_aff_domain_factor_domain(__isl_take isl_aff *aff);
97 int isl_aff_plain_cmp(__isl_keep isl_aff *aff1, __isl_keep isl_aff *aff2);
99 __isl_give isl_aff *isl_aff_remove_unused_divs(__isl_take isl_aff *aff);
100 __isl_give isl_aff *isl_aff_normalize(__isl_take isl_aff *aff);
102 __isl_give isl_aff *isl_aff_expand_divs( __isl_take isl_aff *aff,
103 __isl_take isl_mat *div, int *exp);
105 __isl_give isl_multi_aff *isl_aff_as_domain_extension(__isl_take isl_aff *aff);
107 __isl_give isl_aff *isl_stream_read_aff(__isl_keep isl_stream *s);
109 __isl_give isl_pw_aff *isl_pw_aff_alloc_size(__isl_take isl_space *space,
110 int n);
111 __isl_give isl_pw_aff *isl_pw_aff_reset_space(__isl_take isl_pw_aff *pwaff,
112 __isl_take isl_space *space);
113 __isl_give isl_pw_aff *isl_pw_aff_reset_domain_space(
114 __isl_take isl_pw_aff *pwaff, __isl_take isl_space *space);
115 __isl_give isl_pw_aff *isl_pw_aff_add_disjoint(
116 __isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2);
118 __isl_keep isl_aff *isl_pw_aff_peek_base_at(__isl_keep isl_pw_aff *pa, int pos);
120 __isl_give isl_pw_aff *isl_pw_aff_domain_factor_domain(
121 __isl_take isl_pw_aff *pa);
123 __isl_give isl_pw_aff *isl_pw_aff_union_opt(__isl_take isl_pw_aff *pwaff1,
124 __isl_take isl_pw_aff *pwaff2, int max);
126 __isl_give isl_pw_aff *isl_pw_aff_set_rational(__isl_take isl_pw_aff *pwaff);
127 __isl_give isl_pw_aff_list *isl_pw_aff_list_set_rational(
128 __isl_take isl_pw_aff_list *list);
130 __isl_give isl_aff *isl_aff_scale_down(__isl_take isl_aff *aff, isl_int f);
131 __isl_give isl_pw_aff *isl_pw_aff_scale(__isl_take isl_pw_aff *pwaff,
132 isl_int f);
133 __isl_give isl_pw_aff *isl_pw_aff_scale_down(__isl_take isl_pw_aff *pwaff,
134 isl_int f);
136 __isl_give isl_pw_aff *isl_stream_read_pw_aff(__isl_keep isl_stream *s);
138 isl_bool isl_aff_matching_params(__isl_keep isl_aff *aff,
139 __isl_keep isl_space *space);
140 isl_stat isl_aff_check_match_domain_space(__isl_keep isl_aff *aff,
141 __isl_keep isl_space *space);
143 #undef BASE
144 #define BASE aff
146 #include <isl_multi_templ.h>
148 __isl_give isl_multi_aff *isl_multi_aff_dup(__isl_keep isl_multi_aff *multi);
150 __isl_give isl_multi_aff *isl_multi_aff_align_divs(
151 __isl_take isl_multi_aff *maff);
153 __isl_give isl_multi_aff *isl_multi_aff_from_basic_set_equalities(
154 __isl_take isl_basic_set *bset);
156 __isl_give isl_multi_aff *isl_multi_aff_from_aff_mat(
157 __isl_take isl_space *space, __isl_take isl_mat *mat);
159 #undef EL
160 #define EL isl_pw_multi_aff
162 #include <isl_list_templ.h>
164 __isl_keep isl_multi_aff *isl_pw_multi_aff_peek_base_at(
165 __isl_keep isl_pw_multi_aff *pma, int pos);
167 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_move_dims(
168 __isl_take isl_pw_multi_aff *pma,
169 enum isl_dim_type dst_type, unsigned dst_pos,
170 enum isl_dim_type src_type, unsigned src_pos, unsigned n);
172 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_domain_space(
173 __isl_take isl_pw_multi_aff *pwmaff, __isl_take isl_space *space);
174 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_space(
175 __isl_take isl_pw_multi_aff *pwmaff, __isl_take isl_space *space);
176 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_add_disjoint(
177 __isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2);
179 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_project_out(
180 __isl_take isl_pw_multi_aff *pma,
181 enum isl_dim_type type, unsigned first, unsigned n);
183 isl_stat isl_seq_preimage(isl_int *dst, isl_int *src,
184 __isl_keep isl_multi_aff *ma, int n_before, int n_after,
185 int n_div_ma, int n_div_bmap,
186 isl_int f, isl_int c1, isl_int c2, isl_int g, int has_denom);
188 __isl_give isl_aff *isl_aff_substitute_equalities(__isl_take isl_aff *aff,
189 __isl_take isl_basic_set *eq);
190 __isl_give isl_pw_multi_aff *isl_pw_multi_aff_substitute(
191 __isl_take isl_pw_multi_aff *pma, unsigned pos,
192 __isl_keep isl_pw_aff *subs);
194 __isl_give isl_pw_multi_aff *isl_stream_read_pw_multi_aff(
195 __isl_keep isl_stream *s);
197 __isl_give isl_union_pw_aff *isl_stream_read_union_pw_aff(
198 __isl_keep isl_stream *s);
200 isl_stat isl_pw_aff_check_named_params(__isl_keep isl_pw_aff *pa);
201 isl_stat isl_multi_aff_check_named_params(__isl_keep isl_multi_aff *ma);
202 isl_stat isl_pw_multi_aff_check_named_params(__isl_keep isl_pw_multi_aff *pma);
204 isl_bool isl_pw_aff_matching_params(__isl_keep isl_pw_aff *pa,
205 __isl_keep isl_space *space);
206 isl_stat isl_pw_aff_check_match_domain_space(__isl_keep isl_pw_aff *pa,
207 __isl_keep isl_space *space);
209 __isl_give isl_basic_set *isl_aff_pos_basic_set(__isl_take isl_aff *aff);
211 #undef BASE
212 #define BASE pw_aff
213 #undef DOMBASE
214 #define DOMBASE set
215 #define EXPLICIT_DOMAIN
217 #include <isl_multi_templ.h>
219 #undef EXPLICIT_DOMAIN
221 __isl_give isl_map *isl_map_intersect_multi_pw_aff_explicit_domain(
222 __isl_take isl_map *map, __isl_keep isl_multi_pw_aff *mpa);
224 #undef EL
225 #define EL isl_union_pw_aff
227 #include <isl_list_templ.h>
229 #undef BASE
230 #define BASE union_pw_aff
231 #undef DOMBASE
232 #define DOMBASE union_set
233 #define EXPLICIT_DOMAIN
235 #include <isl_multi_templ.h>
237 #undef EXPLICIT_DOMAIN
239 #undef EL
240 #define EL isl_union_pw_multi_aff
242 #include <isl_list_templ.h>
244 #endif