1 #ifndef ISL_AFF_PRIVATE_H
2 #define ISL_AFF_PRIVATE_H
7 #include <isl/local_space.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.
26 #include <isl_list_templ.h>
28 struct isl_pw_aff_piece
{
41 struct isl_pw_aff_piece p
[1];
47 #include <isl_pw_templ.h>
52 #include <isl_list_templ.h>
54 struct isl_pw_multi_aff_piece
{
59 struct isl_pw_multi_aff
{
67 struct isl_pw_multi_aff_piece p
[1];
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_size
isl_aff_domain_dim(__isl_keep isl_aff
*aff
, enum isl_dim_type type
);
80 isl_size
isl_aff_domain_offset(__isl_keep isl_aff
*aff
, enum isl_dim_type type
);
82 __isl_give isl_aff
*isl_aff_reset_space_and_domain(__isl_take isl_aff
*aff
,
83 __isl_take isl_space
*space
, __isl_take isl_space
*domain
);
84 __isl_give isl_aff
*isl_aff_reset_domain_space(__isl_take isl_aff
*aff
,
85 __isl_take isl_space
*space
);
86 __isl_give isl_aff
*isl_aff_realign_domain(__isl_take isl_aff
*aff
,
87 __isl_take isl_reordering
*r
);
89 __isl_give isl_aff
*isl_aff_set_constant(__isl_take isl_aff
*aff
, isl_int v
);
90 __isl_give isl_aff
*isl_aff_set_coefficient(__isl_take isl_aff
*aff
,
91 enum isl_dim_type type
, int pos
, isl_int v
);
92 __isl_give isl_aff
*isl_aff_add_constant(__isl_take isl_aff
*aff
, isl_int v
);
94 __isl_give isl_aff
*isl_aff_domain_factor_domain(__isl_take isl_aff
*aff
);
96 int isl_aff_plain_cmp(__isl_keep isl_aff
*aff1
, __isl_keep isl_aff
*aff2
);
98 __isl_give isl_aff
*isl_aff_remove_unused_divs(__isl_take isl_aff
*aff
);
99 __isl_give isl_aff
*isl_aff_normalize(__isl_take isl_aff
*aff
);
101 __isl_give isl_aff
*isl_aff_expand_divs( __isl_take isl_aff
*aff
,
102 __isl_take isl_mat
*div
, int *exp
);
104 __isl_give isl_pw_aff
*isl_pw_aff_alloc_size(__isl_take isl_space
*space
,
106 __isl_give isl_pw_aff
*isl_pw_aff_reset_space(__isl_take isl_pw_aff
*pwaff
,
107 __isl_take isl_space
*space
);
108 __isl_give isl_pw_aff
*isl_pw_aff_reset_domain_space(
109 __isl_take isl_pw_aff
*pwaff
, __isl_take isl_space
*space
);
110 __isl_give isl_pw_aff
*isl_pw_aff_add_disjoint(
111 __isl_take isl_pw_aff
*pwaff1
, __isl_take isl_pw_aff
*pwaff2
);
113 __isl_give isl_pw_aff
*isl_pw_aff_domain_factor_domain(
114 __isl_take isl_pw_aff
*pa
);
116 __isl_give isl_pw_aff
*isl_pw_aff_union_opt(__isl_take isl_pw_aff
*pwaff1
,
117 __isl_take isl_pw_aff
*pwaff2
, int max
);
119 __isl_give isl_pw_aff
*isl_pw_aff_set_rational(__isl_take isl_pw_aff
*pwaff
);
120 __isl_give isl_pw_aff_list
*isl_pw_aff_list_set_rational(
121 __isl_take isl_pw_aff_list
*list
);
123 __isl_give isl_aff
*isl_aff_scale_down(__isl_take isl_aff
*aff
, isl_int f
);
124 __isl_give isl_pw_aff
*isl_pw_aff_scale(__isl_take isl_pw_aff
*pwaff
,
126 __isl_give isl_pw_aff
*isl_pw_aff_scale_down(__isl_take isl_pw_aff
*pwaff
,
129 isl_bool
isl_aff_matching_params(__isl_keep isl_aff
*aff
,
130 __isl_keep isl_space
*space
);
131 isl_stat
isl_aff_check_match_domain_space(__isl_keep isl_aff
*aff
,
132 __isl_keep isl_space
*space
);
137 #include <isl_multi_templ.h>
139 __isl_give isl_multi_aff
*isl_multi_aff_dup(__isl_keep isl_multi_aff
*multi
);
141 __isl_give isl_multi_aff
*isl_multi_aff_align_divs(
142 __isl_take isl_multi_aff
*maff
);
144 __isl_give isl_multi_aff
*isl_multi_aff_from_basic_set_equalities(
145 __isl_take isl_basic_set
*bset
);
147 __isl_give isl_multi_aff
*isl_multi_aff_from_aff_mat(
148 __isl_take isl_space
*space
, __isl_take isl_mat
*mat
);
151 #define EL isl_pw_multi_aff
153 #include <isl_list_templ.h>
155 __isl_give isl_pw_multi_aff
*isl_pw_multi_aff_move_dims(
156 __isl_take isl_pw_multi_aff
*pma
,
157 enum isl_dim_type dst_type
, unsigned dst_pos
,
158 enum isl_dim_type src_type
, unsigned src_pos
, unsigned n
);
160 __isl_give isl_pw_multi_aff
*isl_pw_multi_aff_reset_domain_space(
161 __isl_take isl_pw_multi_aff
*pwmaff
, __isl_take isl_space
*space
);
162 __isl_give isl_pw_multi_aff
*isl_pw_multi_aff_reset_space(
163 __isl_take isl_pw_multi_aff
*pwmaff
, __isl_take isl_space
*space
);
164 __isl_give isl_pw_multi_aff
*isl_pw_multi_aff_add_disjoint(
165 __isl_take isl_pw_multi_aff
*pma1
, __isl_take isl_pw_multi_aff
*pma2
);
167 __isl_give isl_pw_multi_aff
*isl_pw_multi_aff_project_out(
168 __isl_take isl_pw_multi_aff
*pma
,
169 enum isl_dim_type type
, unsigned first
, unsigned n
);
171 isl_stat
isl_seq_preimage(isl_int
*dst
, isl_int
*src
,
172 __isl_keep isl_multi_aff
*ma
, int n_before
, int n_after
,
173 int n_div_ma
, int n_div_bmap
,
174 isl_int f
, isl_int c1
, isl_int c2
, isl_int g
, int has_denom
);
176 __isl_give isl_aff
*isl_aff_substitute_equalities(__isl_take isl_aff
*aff
,
177 __isl_take isl_basic_set
*eq
);
178 __isl_give isl_pw_multi_aff
*isl_pw_multi_aff_substitute(
179 __isl_take isl_pw_multi_aff
*pma
, enum isl_dim_type type
, unsigned pos
,
180 __isl_keep isl_pw_aff
*subs
);
182 isl_stat
isl_pw_aff_check_named_params(__isl_keep isl_pw_aff
*pa
);
183 isl_stat
isl_multi_aff_check_named_params(__isl_keep isl_multi_aff
*ma
);
184 isl_stat
isl_pw_multi_aff_check_named_params(__isl_keep isl_pw_multi_aff
*pma
);
186 isl_bool
isl_pw_aff_matching_params(__isl_keep isl_pw_aff
*pa
,
187 __isl_keep isl_space
*space
);
188 isl_stat
isl_pw_aff_check_match_domain_space(__isl_keep isl_pw_aff
*pa
,
189 __isl_keep isl_space
*space
);
191 __isl_give isl_basic_set
*isl_aff_pos_basic_set(__isl_take isl_aff
*aff
);
197 #define EXPLICIT_DOMAIN
199 #include <isl_multi_templ.h>
201 #undef EXPLICIT_DOMAIN
203 __isl_give isl_map
*isl_map_intersect_multi_pw_aff_explicit_domain(
204 __isl_take isl_map
*map
, __isl_keep isl_multi_pw_aff
*mpa
);
207 #define EL isl_union_pw_aff
209 #include <isl_list_templ.h>
212 #define BASE union_pw_aff
214 #define DOMBASE union_set
215 #define EXPLICIT_DOMAIN
217 #include <isl_multi_templ.h>
219 #undef EXPLICIT_DOMAIN
222 #define EL isl_union_pw_multi_aff
224 #include <isl_list_templ.h>