26#define EL_BASE constraint
101 eq = line >= bmap->eq;
194 return bmap->n_eq + bmap->n_ineq;
218 for (i = 0; i < bmap->n_eq; ++i) {
227 for (i = 0; i < bmap->n_ineq; ++i) {
251 isl_constraint_list **list =
user;
255 if (is_div < 0 || is_div)
258 *list = isl_constraint_list_add(*list, constraint);
275 isl_constraint_list *list;
283 "input involves unknown divs",
return NULL);
288 list = isl_constraint_list_alloc(ctx,
n);
291 list = isl_constraint_list_free(list);
310 if (!constraint1 || !constraint2)
312 if (constraint1->eq != constraint2->eq)
327 if (!bmap || !constraint)
394 return n(constraint,
type);
398#define TYPE isl_constraint
414 if (isl_constraint_check_range(constraint,
type, first,
n) < 0)
418 constraint->v->el + 1);
423 for (i = 0; i <
n; ++i)
424 if (active[first + i]) {
443 if (isl_constraint_check_range(constraint,
type,
pos, 1) < 0)
456 if (isl_constraint_check_range(constraint,
type,
pos, 1) < 0)
495 if (isl_constraint_check_range(constraint,
type,
pos, 1) < 0)
510 if (isl_constraint_check_range(constraint,
type,
pos, 1) < 0)
548 if (!constraint || !
v)
552 "expecting integer value",
goto error);
585 if (!constraint || !
v)
589 "expecting integer value",
goto error);
590 if (isl_constraint_check_range(constraint,
type,
pos, 1) < 0)
608 if (isl_constraint_check_range(constraint,
type,
pos, 1) < 0)
661 for (i = 0; i < n_div; ++i) {
664 constraint->v->el, i);
665 if (is_div < 0 || is_div)
692 if (equality < 0 || !equality)
695 constraint->v->el, div);
777 for (i = 0; i < bmap->n_eq; ++i) {
812 isl_int **lower_line, **upper_line;
821 for (i = 0; i < bset->n_ineq; ++i) {
831 for (j = i + 1; j < bset->n_ineq; ++j) {
840 lower_line = &bset->ineq[i];
841 upper_line = &bset->ineq[j];
843 lower_line = &bset->ineq[j];
844 upper_line = &bset->ineq[i];
871 unsigned abs_pos,
int strict)
889 t,
a + 1 + abs_pos + 1,
a[1 + abs_pos],
b + 1 + abs_pos + 1,
918 for (j = 0; j < bset->n_ineq; ++j) {
924 bset->ineq[j], bset->ineq[u], abs_pos, j > u);
948 for (j = 0; j < bset->n_ineq; ++j) {
954 bset->ineq[l], bset->ineq[j], abs_pos, j > l);
974 for (i = 0; i < bset->n_ineq; ++i) {
979 abs_pos, n_upper, i);
986 if (!upper || !context_i)
988 if (
fn(NULL, upper, context_i,
user) < 0)
1016 for (i = 0; i < bset->n_ineq; ++i) {
1021 abs_pos, n_lower, i);
1028 if (!lower || !context_i)
1030 if (
fn(lower, NULL, context_i,
user) < 0)
1059 for (i = 0; i < bset->n_ineq; ++i) {
1064 abs_pos, n_lower, i);
1070 for (j = 0; j < bset->n_ineq; ++j) {
1075 abs_pos, n_upper, j);
1079 bset->ineq[i], bset->ineq[j], abs_pos, 0);
1090 if (!lower || !upper || !context_j)
1092 if (
fn(lower, upper, context_j,
user) < 0)
1144 int n_lower, n_upper;
1155 abs_pos = off +
pos;
1157 for (i = 0; i < bset->n_eq; ++i) {
1166 if (!lower || !upper || !
context)
1173 for (i = 0; i < bset->n_ineq; ++i) {
1184 for (i =
context->n_ineq - 1; i >= 0; --i)
1189 if (!n_lower && !n_upper)
1213 if (isl_constraint_check_range(constraint,
type,
pos, 1) < 0)
1223 "constraint does not define a bound on given dimension",
1332 return last1 - last2;
1367 return last1 - last2;
__isl_null isl_aff * isl_aff_free(__isl_take isl_aff *aff)
__isl_give isl_local_space * isl_aff_get_domain_local_space(__isl_keep isl_aff *aff)
static __isl_give isl_basic_set * bset_from_bmap(__isl_take isl_basic_map *bmap)
static __isl_give isl_basic_map * bset_to_bmap(__isl_take isl_basic_set *bset)
#define isl_die(ctx, errno, msg, code)
#define isl_assert(ctx, test, code)
isl_bool isl_bool_ok(int b)
#define ISL_F_ISSET(p, f)
#define isl_alloc_type(ctx, type)
isl_stat isl_stat(* fn)(__isl_take ISL_KEY *key, __isl_take ISL_VAL *val, void *user)
isl_stat isl_stat(*) void user)
int GMPQAPI() cmp(mp_rat op1, mp_rat op2)
__isl_give isl_aff * isl_aff_normalize(__isl_take isl_aff *aff)
__isl_give isl_aff * isl_aff_alloc(__isl_take isl_local_space *ls)
__isl_give isl_local_space * isl_constraint_get_local_space(__isl_keep isl_constraint *constraint)
isl_size isl_constraint_dim(__isl_keep isl_constraint *constraint, enum isl_dim_type type)
__isl_give isl_map * isl_map_add_constraint(__isl_take isl_map *map, __isl_take isl_constraint *constraint)
__isl_give isl_constraint * isl_inequality_from_aff(__isl_take isl_aff *aff)
int isl_constraint_is_equal(__isl_keep isl_constraint *constraint1, __isl_keep isl_constraint *constraint2)
int isl_constraint_plain_cmp(__isl_keep isl_constraint *c1, __isl_keep isl_constraint *c2)
__isl_give isl_constraint * isl_constraint_set_constant_val(__isl_take isl_constraint *constraint, __isl_take isl_val *v)
__isl_give isl_aff * isl_constraint_get_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, int pos)
__isl_give isl_constraint * isl_constraint_set_constant(__isl_take isl_constraint *constraint, isl_int v)
isl_bool isl_basic_map_has_defining_equality(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, int pos, __isl_give isl_constraint **c)
static __isl_give isl_basic_set * set_largest_lower_bound(__isl_keep isl_basic_set *context, __isl_keep isl_basic_set *bset, unsigned abs_pos, int n_lower, int l)
__isl_give isl_constraint * isl_constraint_alloc_vec(int eq, __isl_take isl_local_space *ls, __isl_take isl_vec *v)
isl_bool isl_constraint_is_upper_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos)
static __isl_give isl_basic_set * set_smallest_upper_bound(__isl_keep isl_basic_set *context, __isl_keep isl_basic_set *bset, unsigned abs_pos, int n_upper, int u)
isl_size isl_basic_map_n_constraint(__isl_keep isl_basic_map *bmap)
__isl_null isl_constraint * isl_constraint_free(__isl_take isl_constraint *c)
__isl_give isl_basic_map * isl_basic_map_add_constraint(__isl_take isl_basic_map *bmap, __isl_take isl_constraint *constraint)
__isl_give isl_constraint * isl_constraint_alloc_equality(__isl_take isl_local_space *ls)
__isl_give isl_constraint * isl_equality_from_aff(__isl_take isl_aff *aff)
__isl_give isl_basic_map * isl_basic_map_from_constraint(__isl_take isl_constraint *constraint)
__isl_give isl_val * isl_constraint_get_constant_val(__isl_keep isl_constraint *constraint)
void isl_constraint_get_constant(__isl_keep isl_constraint *constraint, isl_int *v)
__isl_give isl_constraint * isl_constraint_alloc_inequality(__isl_take isl_local_space *ls)
__isl_give isl_constraint * isl_basic_set_constraint(__isl_take isl_basic_set *bset, isl_int **line)
static isl_stat foreach_bound_pair(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned abs_pos, __isl_take isl_basic_set *context, int n_lower, int n_upper, isl_stat(*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user)
__isl_give isl_constraint * isl_constraint_copy(__isl_keep isl_constraint *constraint)
__isl_give isl_basic_set * isl_basic_set_add_constraint(__isl_take isl_basic_set *bset, __isl_take isl_constraint *constraint)
__isl_give isl_constraint_list * isl_basic_set_get_constraint_list(__isl_keep isl_basic_set *bset)
static isl_stat foreach_lower_bound(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned abs_pos, __isl_take isl_basic_set *context, int n_lower, isl_stat(*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user)
__isl_give isl_constraint * isl_basic_map_constraint(__isl_take isl_basic_map *bmap, isl_int **line)
__isl_give isl_constraint * isl_constraint_cow(__isl_take isl_constraint *c)
static __isl_give isl_constraint * isl_constraint_alloc_aff(int eq, __isl_take isl_aff *aff)
static __isl_keep isl_space * isl_constraint_peek_space(__isl_keep isl_constraint *constraint)
void isl_constraint_get_coefficient(__isl_keep isl_constraint *constraint, enum isl_dim_type type, int pos, isl_int *v)
isl_bool isl_constraint_is_div_equality(__isl_keep isl_constraint *constraint, unsigned div)
isl_bool isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos)
static isl_stat foreach_upper_bound(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned abs_pos, __isl_take isl_basic_set *context, int n_upper, isl_stat(*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user)
isl_stat isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset, isl_stat(*fn)(__isl_take isl_constraint *c, void *user), void *user)
isl_bool isl_basic_set_has_defining_inequalities(struct isl_basic_set *bset, enum isl_dim_type type, int pos, struct isl_constraint **lower, struct isl_constraint **upper)
__isl_give isl_basic_set * isl_basic_set_from_constraint(__isl_take isl_constraint *constraint)
const char * isl_constraint_get_dim_name(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned pos)
isl_bool isl_basic_set_has_defining_equality(__isl_keep isl_basic_set *bset, enum isl_dim_type type, int pos, __isl_give isl_constraint **c)
__isl_give isl_val * isl_constraint_get_coefficient_val(__isl_keep isl_constraint *constraint, enum isl_dim_type type, int pos)
__isl_give isl_set * isl_set_add_constraint(__isl_take isl_set *set, __isl_take isl_constraint *constraint)
isl_bool isl_constraint_is_div_constraint(__isl_keep isl_constraint *constraint)
__isl_give isl_constraint * isl_constraint_negate(__isl_take isl_constraint *constraint)
__isl_give isl_space * isl_constraint_get_space(__isl_keep isl_constraint *constraint)
__isl_give isl_aff * isl_constraint_get_aff(__isl_keep isl_constraint *constraint)
static isl_stat collect_constraint(__isl_take isl_constraint *constraint, void *user)
int isl_constraint_cmp_last_non_zero(__isl_keep isl_constraint *c1, __isl_keep isl_constraint *c2)
isl_stat isl_basic_set_foreach_bound_pair(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned pos, isl_stat(*fn)(__isl_take isl_constraint *lower, __isl_take isl_constraint *upper, __isl_take isl_basic_set *bset, void *user), void *user)
isl_size isl_basic_set_n_constraint(__isl_keep isl_basic_set *bset)
__isl_give isl_constraint * isl_constraint_alloc(int eq, __isl_take isl_local_space *ls)
isl_bool isl_constraint_is_equality(struct isl_constraint *constraint)
isl_stat isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap, isl_stat(*fn)(__isl_take isl_constraint *c, void *user), void *user)
__isl_give isl_constraint_list * isl_basic_map_get_constraint_list(__isl_keep isl_basic_map *bmap)
__isl_give isl_constraint * isl_constraint_set_constant_si(__isl_take isl_constraint *constraint, int v)
__isl_give isl_constraint * isl_constraint_set_coefficient_si(__isl_take isl_constraint *constraint, enum isl_dim_type type, int pos, int v)
static __isl_give isl_basic_set * add_larger_bound_constraint(__isl_take isl_basic_set *bset, isl_int *a, isl_int *b, unsigned abs_pos, int strict)
static isl_bool isl_constraint_involves_dims(__isl_keep isl_constraint *constraint, enum isl_dim_type type, unsigned first, unsigned n)
__isl_give isl_aff * isl_constraint_get_div(__isl_keep isl_constraint *constraint, int pos)
__isl_give isl_constraint * isl_constraint_dup(__isl_keep isl_constraint *c)
isl_ctx * isl_constraint_get_ctx(__isl_keep isl_constraint *c)
__isl_give isl_constraint * isl_constraint_set_coefficient_val(__isl_take isl_constraint *constraint, enum isl_dim_type type, int pos, __isl_take isl_val *v)
#define isl_int_is_zero(i)
#define isl_int_is_one(i)
#define isl_int_is_pos(i)
#define isl_int_is_negone(i)
#define isl_int_is_neg(i)
#define isl_int_neg(r, i)
#define isl_int_add(r, i, j)
#define isl_int_abs_ge(i, j)
#define isl_int_set(r, i)
#define isl_int_abs_cmp(i, j)
#define isl_int_set_si(r, i)
#define isl_int_sub_ui(r, i, j)
#define isl_int_abs(r, i)
isl_bool isl_local_space_is_div_constraint(__isl_keep isl_local_space *ls, isl_int *constraint, unsigned div)
isl_bool isl_local_space_is_div_equality(__isl_keep isl_local_space *ls, isl_int *constraint, unsigned div)
int * isl_local_space_get_active(__isl_keep isl_local_space *ls, isl_int *l)
__isl_keep isl_space * isl_local_space_peek_space(__isl_keep isl_local_space *ls)
unsigned isl_local_space_offset(__isl_keep isl_local_space *ls, enum isl_dim_type type)
int isl_local_space_cmp(__isl_keep isl_local_space *ls1, __isl_keep isl_local_space *ls2)
__isl_give isl_basic_set * isl_basic_set_drop(__isl_take isl_basic_set *bset, enum isl_dim_type type, unsigned first, unsigned n)
unsigned isl_basic_map_offset(__isl_keep isl_basic_map *bmap, enum isl_dim_type type)
__isl_give isl_basic_map * isl_basic_map_from_local_space(__isl_take isl_local_space *ls)
__isl_give isl_basic_set * isl_basic_set_extend_constraints(__isl_take isl_basic_set *base, unsigned n_eq, unsigned n_ineq)
isl_stat isl_basic_set_check_range(__isl_keep isl_basic_set *bset, enum isl_dim_type type, unsigned first, unsigned n)
unsigned isl_basic_set_offset(__isl_keep isl_basic_set *bset, enum isl_dim_type type)
static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type)
int isl_basic_map_alloc_inequality(__isl_keep isl_basic_map *bmap)
isl_size isl_basic_set_var_offset(__isl_keep isl_basic_set *bset, enum isl_dim_type type)
__isl_give isl_basic_set * isl_basic_set_cow(__isl_take isl_basic_set *bset)
int isl_basic_set_drop_inequality(__isl_keep isl_basic_set *bset, unsigned pos)
int isl_basic_map_alloc_equality(__isl_keep isl_basic_map *bmap)
__isl_give isl_basic_map * isl_basic_map_extend_constraints(__isl_take isl_basic_map *base, unsigned n_eq, unsigned n_ineq)
isl_bool isl_basic_map_divs_known(__isl_keep isl_basic_map *bmap)
int isl_basic_set_alloc_inequality(__isl_keep isl_basic_set *bset)
#define ISL_BASIC_SET_FINAL
__isl_give isl_basic_set * isl_basic_set_simplify(__isl_take isl_basic_set *bset)
__isl_give isl_basic_set * isl_basic_set_finalize(__isl_take isl_basic_set *bset)
isl_stat isl_basic_map_check_range(__isl_keep isl_basic_map *bmap, enum isl_dim_type type, unsigned first, unsigned n)
#define ISL_BASIC_MAP_FINAL
void isl_seq_combine(isl_int *dst, isl_int m1, isl_int *src1, isl_int m2, isl_int *src2, unsigned len)
int isl_seq_last_non_zero(isl_int *p, unsigned len)
int isl_seq_is_neg(isl_int *p1, isl_int *p2, unsigned len)
int isl_seq_first_non_zero(isl_int *p, unsigned len)
int isl_seq_cmp(isl_int *p1, isl_int *p2, unsigned len)
void isl_seq_cpy(isl_int *dst, isl_int *src, unsigned len)
void isl_seq_neg(isl_int *dst, isl_int *src, unsigned len)
isl_stat isl_space_check_is_set(__isl_keep isl_space *space)
static __isl_give isl_union_map * total(__isl_take isl_union_map *umap, __isl_give isl_map *(*fn)(__isl_take isl_map *))
__isl_give isl_val * isl_val_int_from_isl_int(isl_ctx *ctx, isl_int n)
__isl_give isl_vec * isl_vec_cow(__isl_take isl_vec *vec)
__isl_give isl_aff * isl_local_space_get_div(__isl_keep isl_local_space *ls, int pos)
const char * isl_local_space_get_dim_name(__isl_keep isl_local_space *ls, enum isl_dim_type type, unsigned pos)
isl_ctx * isl_local_space_get_ctx(__isl_keep isl_local_space *ls)
isl_bool isl_local_space_is_equal(__isl_keep isl_local_space *ls1, __isl_keep isl_local_space *ls2)
isl_size isl_local_space_dim(__isl_keep isl_local_space *ls, enum isl_dim_type type)
__isl_null isl_local_space * isl_local_space_free(__isl_take isl_local_space *ls)
__isl_give isl_local_space * isl_local_space_copy(__isl_keep isl_local_space *ls)
__isl_give isl_space * isl_local_space_get_space(__isl_keep isl_local_space *ls)
__isl_export __isl_give isl_map * isl_map_intersect(__isl_take isl_map *map1, __isl_take isl_map *map2)
__isl_null isl_basic_map * isl_basic_map_free(__isl_take isl_basic_map *bmap)
isl_ctx * isl_basic_map_get_ctx(__isl_keep isl_basic_map *bmap)
isl_size isl_basic_map_dim(__isl_keep isl_basic_map *bmap, enum isl_dim_type type)
__isl_give isl_local_space * isl_basic_map_get_local_space(__isl_keep isl_basic_map *bmap)
__isl_constructor __isl_give isl_map * isl_map_from_basic_map(__isl_take isl_basic_map *bmap)
__isl_give isl_basic_map * isl_basic_map_copy(__isl_keep isl_basic_map *bmap)
__isl_export __isl_give isl_basic_map * isl_basic_map_intersect(__isl_take isl_basic_map *bmap1, __isl_take isl_basic_map *bmap2)
struct isl_basic_set isl_basic_set
isl_size isl_basic_set_dim(__isl_keep isl_basic_set *bset, enum isl_dim_type type)
__isl_give isl_basic_set * isl_basic_set_remove_dims(__isl_take isl_basic_set *bset, enum isl_dim_type type, unsigned first, unsigned n)
__isl_null isl_basic_set * isl_basic_set_free(__isl_take isl_basic_set *bset)
__isl_export isl_bool isl_basic_set_is_empty(__isl_keep isl_basic_set *bset)
__isl_give isl_basic_set * isl_basic_set_copy(__isl_keep isl_basic_set *bset)
__isl_null isl_space * isl_space_free(__isl_take isl_space *space)
__isl_export isl_bool isl_space_is_equal(__isl_keep isl_space *space1, __isl_keep isl_space *space2)
__isl_null isl_val * isl_val_free(__isl_take isl_val *v)
__isl_export isl_bool isl_val_is_int(__isl_keep isl_val *v)
isl_ctx * isl_vec_get_ctx(__isl_keep isl_vec *vec)
__isl_null isl_vec * isl_vec_free(__isl_take isl_vec *vec)
__isl_give isl_vec * isl_vec_copy(__isl_keep isl_vec *vec)
isl_bool isl_vec_is_equal(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2)
__isl_give isl_vec * isl_vec_drop_els(__isl_take isl_vec *vec, unsigned pos, unsigned n)
__isl_give isl_vec * isl_vec_set_element_val(__isl_take isl_vec *vec, int pos, __isl_take isl_val *v)
__isl_give isl_vec * isl_vec_neg(__isl_take isl_vec *vec)
__isl_give isl_vec * isl_vec_clr(__isl_take isl_vec *vec)
__isl_give isl_vec * isl_vec_alloc(isl_ctx *ctx, unsigned size)