isl_qpolynomial_morph: properly handle change in number of variables
[isl.git] / isl_map_private.h
blobcc7d8c77b2282801ab32b379942799269faa7c0f
1 /*
2 * Copyright 2008-2009 Katholieke Universiteit Leuven
4 * Use of this software is governed by the GNU LGPLv2.1 license
6 * Written by Sven Verdoolaege, K.U.Leuven, Departement
7 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
8 */
10 #ifndef ISL_MAP_PRIVATE_H
11 #define ISL_MAP_PRIVATE_H
13 #include "isl_set.h"
14 #include "isl_map.h"
15 #include <isl_reordering.h>
16 #include "isl_vec.h"
18 __isl_give isl_map *isl_map_realign(__isl_take isl_map *map,
19 __isl_take isl_reordering *r);
20 __isl_give isl_set *isl_set_realign(__isl_take isl_set *set,
21 __isl_take isl_reordering *r);
23 __isl_give isl_map *isl_map_reset(__isl_take isl_map *map,
24 enum isl_dim_type type);
26 __isl_give isl_basic_map *isl_basic_map_reset_dim(
27 __isl_take isl_basic_map *bmap, __isl_take isl_dim *dim);
28 __isl_give isl_map *isl_map_reset_dim(__isl_take isl_map *map,
29 __isl_take isl_dim *dim);
30 __isl_give isl_set *isl_set_reset_dim(__isl_take isl_set *set,
31 __isl_take isl_dim *dim);
33 unsigned isl_basic_map_offset(struct isl_basic_map *bmap,
34 enum isl_dim_type type);
36 int isl_map_compatible_domain(struct isl_map *map, struct isl_set *set);
37 int isl_basic_map_compatible_domain(struct isl_basic_map *bmap,
38 struct isl_basic_set *bset);
39 int isl_basic_map_compatible_range(struct isl_basic_map *bmap,
40 struct isl_basic_set *bset);
42 struct isl_basic_map *isl_basic_map_extend_dim(struct isl_basic_map *base,
43 struct isl_dim *dim, unsigned extra,
44 unsigned n_eq, unsigned n_ineq);
45 struct isl_basic_set *isl_basic_set_extend_dim(struct isl_basic_set *base,
46 struct isl_dim *dim, unsigned extra,
47 unsigned n_eq, unsigned n_ineq);
48 struct isl_basic_set *isl_basic_set_add_constraints(struct isl_basic_set *bset1,
49 struct isl_basic_set *bset2, unsigned pos);
51 struct isl_map *isl_map_grow(struct isl_map *map, int n);
52 struct isl_set *isl_set_grow(struct isl_set *set, int n);
54 int isl_basic_set_contains(struct isl_basic_set *bset, struct isl_vec *vec);
55 int isl_basic_map_contains(struct isl_basic_map *bmap, struct isl_vec *vec);
57 struct isl_basic_set *isl_basic_set_alloc_dim(struct isl_dim *dim,
58 unsigned extra, unsigned n_eq, unsigned n_ineq);
59 struct isl_set *isl_set_alloc_dim(struct isl_dim *dim, int n, unsigned flags);
60 struct isl_basic_map *isl_basic_map_alloc_dim(struct isl_dim *dim,
61 unsigned extra, unsigned n_eq, unsigned n_ineq);
62 struct isl_map *isl_map_alloc_dim(struct isl_dim *dim, int n, unsigned flags);
64 unsigned isl_basic_map_total_dim(const struct isl_basic_map *bmap);
66 int isl_basic_map_alloc_equality(struct isl_basic_map *bmap);
67 int isl_basic_set_alloc_equality(struct isl_basic_set *bset);
68 int isl_basic_set_free_inequality(struct isl_basic_set *bset, unsigned n);
69 int isl_basic_map_free_equality(struct isl_basic_map *bmap, unsigned n);
70 int isl_basic_set_free_equality(struct isl_basic_set *bset, unsigned n);
71 int isl_basic_set_alloc_inequality(struct isl_basic_set *bset);
72 int isl_basic_map_alloc_inequality(struct isl_basic_map *bmap);
73 int isl_basic_map_free_inequality(struct isl_basic_map *bmap, unsigned n);
74 int isl_basic_map_alloc_div(struct isl_basic_map *bmap);
75 int isl_basic_set_alloc_div(struct isl_basic_set *bset);
76 int isl_basic_map_free_div(struct isl_basic_map *bmap, unsigned n);
77 int isl_basic_set_free_div(struct isl_basic_set *bset, unsigned n);
78 void isl_basic_map_inequality_to_equality(
79 struct isl_basic_map *bmap, unsigned pos);
80 int isl_basic_map_drop_equality(struct isl_basic_map *bmap, unsigned pos);
81 int isl_basic_set_drop_equality(struct isl_basic_set *bset, unsigned pos);
82 int isl_basic_set_drop_inequality(struct isl_basic_set *bset, unsigned pos);
83 int isl_basic_map_drop_inequality(struct isl_basic_map *bmap, unsigned pos);
84 __isl_give isl_basic_set *isl_basic_set_add_eq(__isl_take isl_basic_set *bset,
85 isl_int *eq);
86 __isl_give isl_basic_map *isl_basic_map_add_eq(__isl_take isl_basic_map *bmap,
87 isl_int *eq);
88 __isl_give isl_basic_set *isl_basic_set_add_ineq(__isl_take isl_basic_set *bset,
89 isl_int *ineq);
90 __isl_give isl_basic_map *isl_basic_map_add_ineq(__isl_take isl_basic_map *bmap,
91 isl_int *ineq);
93 int isl_inequality_negate(struct isl_basic_map *bmap, unsigned pos);
95 struct isl_basic_set *isl_basic_set_cow(struct isl_basic_set *bset);
96 struct isl_basic_map *isl_basic_map_cow(struct isl_basic_map *bmap);
97 struct isl_set *isl_set_cow(struct isl_set *set);
98 struct isl_map *isl_map_cow(struct isl_map *map);
100 struct isl_basic_map *isl_basic_map_set_to_empty(struct isl_basic_map *bmap);
101 struct isl_basic_set *isl_basic_set_set_to_empty(struct isl_basic_set *bset);
102 struct isl_basic_set *isl_basic_set_order_divs(struct isl_basic_set *bset);
103 void isl_basic_map_swap_div(struct isl_basic_map *bmap, int a, int b);
104 struct isl_basic_map *isl_basic_map_order_divs(struct isl_basic_map *bmap);
105 __isl_give isl_map *isl_map_order_divs(__isl_take isl_map *map);
106 struct isl_basic_map *isl_basic_map_align_divs(
107 struct isl_basic_map *dst, struct isl_basic_map *src);
108 struct isl_basic_set *isl_basic_set_align_divs(
109 struct isl_basic_set *dst, struct isl_basic_set *src);
110 struct isl_basic_map *isl_basic_map_gauss(
111 struct isl_basic_map *bmap, int *progress);
112 struct isl_basic_set *isl_basic_set_gauss(
113 struct isl_basic_set *bset, int *progress);
114 __isl_give isl_basic_set *isl_basic_set_sort_constraints(
115 __isl_take isl_basic_set *bset);
116 int isl_basic_map_fast_cmp(const __isl_keep isl_basic_map *bmap1,
117 const __isl_keep isl_basic_map *bmap2);
118 int isl_basic_set_fast_is_equal(__isl_keep isl_basic_set *bset1,
119 __isl_keep isl_basic_set *bset2);
120 int isl_basic_map_fast_is_equal(__isl_keep isl_basic_map *bmap1,
121 __isl_keep isl_basic_map *bmap2);
122 struct isl_basic_map *isl_basic_map_normalize_constraints(
123 struct isl_basic_map *bmap);
124 struct isl_basic_set *isl_basic_set_normalize_constraints(
125 struct isl_basic_set *bset);
126 struct isl_basic_map *isl_basic_map_implicit_equalities(
127 struct isl_basic_map *bmap);
128 struct isl_basic_set *isl_basic_map_underlying_set(struct isl_basic_map *bmap);
129 __isl_give isl_basic_set *isl_basic_set_underlying_set(
130 __isl_take isl_basic_set *bset);
131 struct isl_set *isl_map_underlying_set(struct isl_map *map);
132 struct isl_basic_map *isl_basic_map_overlying_set(struct isl_basic_set *bset,
133 struct isl_basic_map *like);
134 __isl_give isl_basic_set *isl_basic_set_drop_constraints_involving(
135 __isl_take isl_basic_set *bset, unsigned first, unsigned n);
136 __isl_give isl_basic_set *isl_basic_set_drop(__isl_take isl_basic_set *bset,
137 enum isl_dim_type type, unsigned first, unsigned n);
138 struct isl_basic_map *isl_basic_map_drop(struct isl_basic_map *bmap,
139 enum isl_dim_type type, unsigned first, unsigned n);
140 struct isl_set *isl_set_drop(struct isl_set *set,
141 enum isl_dim_type type, unsigned first, unsigned n);
142 struct isl_basic_set *isl_basic_set_drop_dims(
143 struct isl_basic_set *bset, unsigned first, unsigned n);
144 struct isl_set *isl_set_drop_dims(
145 struct isl_set *set, unsigned first, unsigned n);
146 struct isl_map *isl_map_drop_inputs(
147 struct isl_map *map, unsigned first, unsigned n);
148 struct isl_map *isl_map_drop(struct isl_map *map,
149 enum isl_dim_type type, unsigned first, unsigned n);
151 struct isl_map *isl_map_remove_empty_parts(struct isl_map *map);
152 struct isl_set *isl_set_remove_empty_parts(struct isl_set *set);
154 struct isl_set *isl_set_normalize(struct isl_set *set);
156 struct isl_set *isl_set_drop_vars(
157 struct isl_set *set, unsigned first, unsigned n);
159 struct isl_basic_map *isl_basic_map_eliminate_vars(
160 struct isl_basic_map *bmap, unsigned pos, unsigned n);
161 struct isl_basic_set *isl_basic_set_eliminate_vars(
162 struct isl_basic_set *bset, unsigned pos, unsigned n);
164 __isl_give isl_map *isl_map_eliminate(__isl_take isl_map *map,
165 enum isl_dim_type type, unsigned first, unsigned n);
166 __isl_give isl_set *isl_set_eliminate(__isl_take isl_set *set,
167 enum isl_dim_type type, unsigned first, unsigned n);
169 int isl_basic_set_constraint_is_redundant(struct isl_basic_set **bset,
170 isl_int *c, isl_int *opt_n, isl_int *opt_d);
172 int isl_basic_map_add_div_constraints(struct isl_basic_map *bmap, unsigned div);
173 struct isl_basic_map *isl_basic_map_drop_redundant_divs(
174 struct isl_basic_map *bmap);
175 struct isl_basic_set *isl_basic_set_drop_redundant_divs(
176 struct isl_basic_set *bset);
178 struct isl_basic_set *isl_basic_set_recession_cone(struct isl_basic_set *bset);
179 struct isl_basic_set *isl_basic_set_lineality_space(struct isl_basic_set *bset);
181 struct isl_basic_set *isl_basic_set_set_rational(struct isl_basic_set *bset);
183 struct isl_mat;
185 struct isl_basic_set *isl_basic_set_preimage(struct isl_basic_set *bset,
186 struct isl_mat *mat);
187 struct isl_set *isl_set_preimage(struct isl_set *set, struct isl_mat *mat);
189 isl_int *isl_set_wrap_facet(__isl_keep isl_set *set,
190 isl_int *facet, isl_int *ridge);
192 int isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap,
193 __isl_keep isl_point *point);
194 int isl_set_contains_point(__isl_keep isl_set *set, __isl_keep isl_point *point);
196 int isl_basic_set_vars_get_sign(__isl_keep isl_basic_set *bset,
197 unsigned first, unsigned n, int *signs);
199 int isl_basic_set_add_div_constraints_var(__isl_keep isl_basic_set *bset,
200 unsigned pos, isl_int *div);
201 int isl_basic_map_is_div_constraint(__isl_keep isl_basic_map *bmap,
202 isl_int *constraint, unsigned div);
204 #endif