45 if (--vertices->ref > 0)
48 for (i = 0; i < vertices->n_vertices; ++i) {
54 for (i = 0; i < vertices->n_chambers; ++i) {
55 free(vertices->c[i].vertices);
75 for (; list; list =
next) {
98 if (n_vertices && !vertices->
v)
102 for (i = 0; list; list =
next, i++) {
104 vertices->
v[i] = list->
v;
152 if (
v->v.
dom->n_eq > 0) {
225 if (!vertices->
c[0].
dom)
245 facets->n_row =
n + 1;
282 indep =
is_independent(facets, selected, bset->ineq[level] + 1 + ovar);
283 if (indep < 0 || !indep)
296 for (i = 0; i < level; ++i) {
426 int *selection = NULL;
475 if (n_eq < 0 || n_eq > 0)
482 if ((copy->n_ineq && (!selection || !snap)) || !facets)
490 if (level >= copy->n_ineq ||
499 ok =
can_select(copy, level, tab, facets, selected,
514 if (selected == nvar) {
515 if (tab->
n_dead == nvar) {
559 for (; list; list =
next) {
578 for (i = 0; i < bset->n_ineq; ++i) {
602 vertices->n_chambers = n_chambers;
604 for (i = 0; list; list =
next, i++) {
606 vertices->
c[i] = list->
c;
629 "expecting full-dimensional input",
637 for (i = 0; i < bset->n_ineq; ++i) {
669 for (i = 0; i < vertices->n_vertices; ++i)
699 for (i = 0, j = 0; i < vertices->n_vertices; ++i)
708 for (i = 0; i < n_frozen; ++i)
778 for (i = 0; i < n_frozen; ++i)
830 for (; *list; list = &(*list)->
next) {
923 int *selection = NULL;
928 if (!
bset || !vertices)
933 if (vertices->n_vertices && !selection)
942 "expecting full-dimensional input",
goto error);
947 for (i = 0; i <
bset->n_ineq; ++i)
956 for (i = 0; i < vertices->n_vertices; ++i) {
958 if (selection[i] < 0)
963 if (selection[i] < 0)
988 for (i = 0; i < vertices->n_vertices; ++i) {
991 if (selection[i] < 0)
996 if (selection[i] < 0)
1023 for (i = 0; vertices && i < vertices->n_vertices; ++i) {
1025 vertices->v[i].dom = NULL;
1101 vertex->vertices = vertices;
1122 return cell ? cell->dom->ctx : NULL;
1136 if (!vertices || !
dom)
1148 cell->
ids[i] = vertices->c[
id].vertices[i];
1187 tab =
isl_tab_alloc(bset->ctx, bset->n_eq + bset->n_ineq + 1,
1203 for (i = 0; i < bset->n_eq; ++i) {
1210 for (i = 0; i < bset->n_ineq; ++i) {
1273 if (vertices->n_chambers == 0)
1276 if (vertices->n_chambers == 1) {
1289 for (i = 0; i < vertices->n_chambers; ++i) {
1320 if (vertices->n_chambers == 0)
1323 for (i = 0; i < vertices->n_chambers; ++i) {
1348 if (vertices->n_vertices == 0)
1351 for (i = 0; i < vertices->n_vertices; ++i) {
1375 if (cell->n_vertices == 0)
1378 for (i = 0; i < cell->n_vertices; ++i) {
1396 return vertices ? vertices->bset->ctx : NULL;
1410 if (!morph || !vertices)
1413 isl_assert(vertices->bset->ctx, vertices->ref == 1,
goto error);
1419 for (i = 0; i < vertices->n_vertices; ++i) {
1424 if (!vertices->v[i].vertex)
1428 for (i = 0; i < vertices->n_chambers; ++i) {
1431 if (!vertices->c[i].dom)
1449 int *simplex_ids,
int n_simplex,
int *other_ids,
int n_other,
1462 if (!simplex->vertices)
1467 simplex->n_vertices = n_simplex + n_other;
1472 for (i = 0; i < n_simplex; ++i)
1473 simplex->ids[i] = simplex_ids[i];
1474 for (i = 0; i < n_other; ++i)
1475 simplex->ids[n_simplex + i] = other_ids[i];
1477 return fn(simplex,
user);
1504 for (i = 0; i < vertex->n_eq; ++i) {
1524 int *simplex_ids,
int n_simplex,
int *other_ids,
int n_other,
1537 if (d < 0 || nparam < 0)
1540 if (n_simplex + n_other == d + 1)
1542 other_ids, n_other,
fn,
user);
1544 simplex_ids[n_simplex] = other_ids[0];
1545 vertex = cell->vertices->v[other_ids[0]].vertex;
1546 bset = cell->vertices->bset;
1551 for (i = 0; i < bset->n_ineq; ++i) {
1557 for (j = 1, k = 0; j < n_other; ++j) {
1559 ov = cell->vertices->v[other_ids[j]].vertex;
1561 ids[k++] = other_ids[j];
1566 if (
triangulate(cell, v, simplex_ids, n_simplex + 1,
1588 int *simplex_ids = NULL;
1595 if (d < 0 ||
total < 0)
1598 if (cell->n_vertices == d + 1)
1611 cell->ids, cell->n_vertices,
fn,
user);
struct isl_multi_aff isl_multi_aff
for(int c0=1;c0< 3 *M - 1;c0+=3)
#define isl_calloc_type(ctx, type)
#define isl_die(ctx, errno, msg, code)
#define isl_assert(ctx, test, code)
isl_bool isl_bool_ok(int b)
#define isl_alloc_array(ctx, type, n)
#define isl_calloc_array(ctx, type, n)
#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)
isl_bool isl_bool(* test)(__isl_keep ISL_KEY *key, __isl_keep ISL_VAL *val, void *user)
int GMPQAPI() sgn(mp_rat op)
void GMPQAPI() init(mp_rat x)
__isl_give isl_multi_aff * isl_multi_aff_from_basic_set_equalities(__isl_take isl_basic_set *bset)
static void drop(struct isl_coalesce_info *info)
#define isl_int_set_si(r, i)
isl_bool isl_basic_set_contains(__isl_keep isl_basic_set *bset, __isl_keep isl_vec *vec)
isl_size isl_basic_set_n_equality(__isl_keep isl_basic_set *bset)
__isl_give isl_basic_set * isl_basic_set_tighten_outward(__isl_take isl_basic_set *bset, __isl_keep isl_vec *vec)
isl_stat isl_basic_set_check_no_locals(__isl_keep isl_basic_set *bset)
__isl_give isl_basic_set * isl_basic_set_cow(__isl_take isl_basic_set *bset)
__isl_give isl_basic_set * isl_basic_set_set_rational(__isl_take isl_basic_set *bset)
__isl_give isl_basic_set * isl_basic_set_set_integral(__isl_take isl_basic_set *bset)
__isl_give isl_basic_set * isl_basic_set_sort_constraints(__isl_take isl_basic_set *bset)
#define ISL_BASIC_SET_RATIONAL
#define ISL_BASIC_SET_NO_REDUNDANT
#define ISL_BASIC_MAP_EMPTY
__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_give isl_morph * isl_basic_set_full_compression(__isl_keep isl_basic_set *bset)
__isl_give isl_morph * isl_morph_inverse(__isl_take isl_morph *morph)
__isl_give isl_morph * isl_morph_ran_params(__isl_take isl_morph *morph)
__isl_give isl_morph * isl_morph_dom_params(__isl_take isl_morph *morph)
__isl_null isl_morph * isl_morph_free(__isl_take isl_morph *morph)
__isl_give isl_basic_set * isl_morph_basic_set(__isl_take isl_morph *morph, __isl_take isl_basic_set *bset)
__isl_give isl_morph * isl_morph_copy(__isl_keep isl_morph *morph)
int isl_seq_last_non_zero(isl_int *p, unsigned len)
int isl_seq_first_non_zero(isl_int *p, unsigned len)
void isl_seq_clr(isl_int *p, unsigned len)
void isl_seq_elim(isl_int *dst, isl_int *src, unsigned pos, unsigned len, isl_int *m)
void isl_seq_cpy(isl_int *dst, isl_int *src, unsigned len)
void isl_seq_neg(isl_int *dst, isl_int *src, unsigned len)
unsigned isl_space_offset(__isl_keep isl_space *space, enum isl_dim_type type)
int isl_tab_detect_redundant(struct isl_tab *tab)
void isl_tab_free(struct isl_tab *tab)
int isl_tab_is_redundant(struct isl_tab *tab, int con)
isl_stat isl_tab_add_eq(struct isl_tab *tab, isl_int *eq)
__isl_keep isl_basic_set * isl_tab_peek_bset(struct isl_tab *tab)
struct isl_tab_undo * isl_tab_snap(struct isl_tab *tab)
int isl_tab_sign_of_max(struct isl_tab *tab, int con)
int isl_tab_is_equality(struct isl_tab *tab, int con)
__isl_give isl_basic_set * isl_basic_set_update_from_tab(__isl_take isl_basic_set *bset, struct isl_tab *tab)
isl_stat isl_tab_mark_empty(struct isl_tab *tab)
isl_stat isl_tab_add_ineq(struct isl_tab *tab, isl_int *ineq)
__isl_give isl_vec * isl_tab_get_sample_value(struct isl_tab *tab)
struct isl_tab * isl_tab_dup(struct isl_tab *tab)
struct isl_tab * isl_tab_alloc(struct isl_ctx *ctx, unsigned n_row, unsigned n_var, unsigned M)
enum isl_ineq_type isl_tab_ineq_type(struct isl_tab *tab, isl_int *ineq)
int isl_tab_detect_implicit_equalities(struct isl_tab *tab)
__isl_give struct isl_tab * isl_tab_from_basic_set(__isl_keep isl_basic_set *bset, int track)
isl_stat isl_tab_rollback(struct isl_tab *tab, struct isl_tab_undo *snap)
int isl_tab_freeze_constraint(struct isl_tab *tab, int con)
int isl_tab_select_facet(struct isl_tab *tab, int con)
int isl_tab_extend_cons(struct isl_tab *tab, unsigned n_new)
static __isl_give isl_union_map * total(__isl_take isl_union_map *umap, __isl_give isl_map *(*fn)(__isl_take isl_map *))
static __isl_give isl_vertices * vertices_empty(__isl_keep isl_basic_set *bset)
static __isl_give isl_vertices * compute_chambers(__isl_take isl_basic_set *bset, __isl_take isl_vertices *vertices)
isl_stat isl_vertices_foreach_cell(__isl_keep isl_vertices *vertices, isl_stat(*fn)(__isl_take isl_cell *cell, void *user), void *user)
static int init_todo(struct isl_facet_todo **next, struct isl_tab *tab)
static struct isl_vertex_list * free_vertex_list(struct isl_vertex_list *list)
__isl_null isl_vertices * isl_vertices_free(__isl_take isl_vertices *vertices)
__isl_give isl_vertices * isl_vertices_copy(__isl_keep isl_vertices *vertices)
isl_size isl_vertices_get_n_vertices(__isl_keep isl_vertices *vertices)
__isl_null isl_vertex * isl_vertex_free(__isl_take isl_vertex *vertex)
static __isl_give isl_vertices * vertices_add_chambers(__isl_take isl_vertices *vertices, int n_chambers, struct isl_chamber_list *list)
isl_stat isl_cell_foreach_vertex(__isl_keep isl_cell *cell, isl_stat(*fn)(__isl_take isl_vertex *vertex, void *user), void *user)
static __isl_give isl_vertex * isl_vertex_alloc(__isl_take isl_vertices *vertices, int id)
static void free_chamber_list(struct isl_chamber_list *list)
isl_ctx * isl_vertices_get_ctx(__isl_keep isl_vertices *vertices)
isl_ctx * isl_vertex_get_ctx(__isl_keep isl_vertex *vertex)
static isl_bool bset_covers_tab(__isl_keep isl_basic_set *bset, struct isl_tab *tab)
static __isl_give isl_vertices * vertices_0D(__isl_keep isl_basic_set *bset)
__isl_give isl_vertices * isl_morph_vertices(__isl_take isl_morph *morph, __isl_take isl_vertices *vertices)
static isl_bool can_intersect(struct isl_tab *tab, __isl_keep isl_basic_set *bset)
static __isl_give isl_vertices * lower_dim_vertices_free(__isl_take isl_basic_set *bset, __isl_take isl_basic_set *copy, struct isl_tab *tab)
static isl_bool is_independent(__isl_keep isl_mat *facets, int n, isl_int *f)
static int add_chamber(struct isl_chamber_list **list, __isl_keep isl_vertices *vertices, struct isl_tab *tab, int *selection)
static __isl_give isl_vertices * vertices_from_list(__isl_keep isl_basic_set *bset, int n_vertices, struct isl_vertex_list *list)
static isl_bool can_select(__isl_keep isl_basic_set *bset, int level, struct isl_tab *tab, __isl_keep isl_mat *facets, int selected, int *selection)
__isl_give isl_basic_set * isl_cell_get_domain(__isl_keep isl_cell *cell)
isl_stat isl_vertices_foreach_vertex(__isl_keep isl_vertices *vertices, isl_stat(*fn)(__isl_take isl_vertex *vertex, void *user), void *user)
isl_size isl_vertex_get_id(__isl_keep isl_vertex *vertex)
static __isl_give isl_vertices * lower_dim_vertices(__isl_take isl_basic_set *bset)
__isl_give isl_basic_set * isl_vertex_get_domain(__isl_keep isl_vertex *vertex)
static int has_opposite(struct isl_facet_todo *todo, struct isl_facet_todo **list)
static struct isl_facet_todo * create_todo(struct isl_tab *tab, int con)
__isl_give isl_vertices * isl_basic_set_compute_vertices(__isl_keep isl_basic_set *bset)
isl_stat isl_cell_foreach_simplex(__isl_take isl_cell *cell, isl_stat(*fn)(__isl_take isl_cell *simplex, void *user), void *user)
static __isl_give isl_basic_set * detect_implicit_equality_constraints(__isl_keep isl_basic_set *bset, struct isl_tab *tab)
isl_ctx * isl_cell_get_ctx(__isl_keep isl_cell *cell)
static __isl_give isl_cell * isl_cell_alloc(__isl_take isl_vertices *vertices, __isl_take isl_basic_set *dom, int id)
static isl_stat triangulate(__isl_keep isl_cell *cell, __isl_keep isl_vec *v, int *simplex_ids, int n_simplex, int *other_ids, int n_other, isl_stat(*fn)(__isl_take isl_cell *simplex, void *user), void *user)
static int vertex_on_facet(__isl_keep isl_basic_set *vertex, __isl_keep isl_basic_set *bset, int facet, __isl_keep isl_vec *v)
isl_stat isl_vertices_foreach_disjoint_cell(__isl_keep isl_vertices *vertices, isl_stat(*fn)(__isl_take isl_cell *cell, void *user), void *user)
static isl_bool add_vertex(struct isl_vertex_list **list, __isl_keep isl_basic_set *bset, struct isl_tab *tab)
static void free_todo(struct isl_facet_todo *todo)
static struct isl_tab * tab_for_shifted_cone(__isl_keep isl_basic_set *bset)
__isl_give isl_multi_aff * isl_vertex_get_expr(__isl_keep isl_vertex *vertex)
static isl_stat call_on_simplex(__isl_keep isl_cell *cell, int *simplex_ids, int n_simplex, int *other_ids, int n_other, isl_stat(*fn)(__isl_take isl_cell *simplex, void *user), void *user)
static int update_todo(struct isl_facet_todo *first, struct isl_tab *tab)
static __isl_give isl_vec * isl_basic_set_interior_point(__isl_keep isl_basic_set *bset)
__isl_null isl_cell * isl_cell_free(__isl_take isl_cell *cell)
struct isl_basic_set isl_basic_set
__isl_null isl_mat * isl_mat_free(__isl_take isl_mat *mat)
__isl_give isl_mat * isl_mat_alloc(isl_ctx *ctx, unsigned n_row, unsigned n_col)
isl_size isl_mat_rank(__isl_keep isl_mat *mat)
isl_size isl_basic_set_dim(__isl_keep isl_basic_set *bset, enum isl_dim_type type)
__isl_export __isl_give isl_basic_set * isl_basic_set_params(__isl_take isl_basic_set *bset)
__isl_null isl_basic_set * isl_basic_set_free(__isl_take isl_basic_set *bset)
isl_bool isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset)
isl_bool isl_basic_set_plain_is_equal(__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2)
isl_ctx * isl_basic_set_get_ctx(__isl_keep isl_basic_set *bset)
__isl_give isl_basic_set * isl_basic_set_copy(__isl_keep isl_basic_set *bset)
struct isl_chamber_list * next
struct isl_facet_todo * next
struct isl_basic_map * bmap
unsigned strict_redundant
struct isl_vertex_list * next
__isl_null isl_vec * isl_vec_free(__isl_take isl_vec *vec)
__isl_give isl_vec * isl_vec_alloc(isl_ctx *ctx, unsigned size)