Lines Matching full:tab
115 /* Prepend a vertex to the linked list "list" based on the equalities in "tab".
123 __isl_keep isl_basic_set *bset, struct isl_tab *tab) in add_vertex() argument
128 if (isl_tab_detect_implicit_equalities(tab) < 0) in add_vertex()
135 v = isl_calloc_type(tab->mat->ctx, struct isl_vertex_list); in add_vertex()
141 v->v.vertex = isl_basic_set_update_from_tab(v->v.vertex, tab); in add_vertex()
254 * reflected by facets in "tab", the rows of "facets" and the earlier
269 struct isl_tab *tab, __isl_keep isl_mat *facets, int selected, in can_select() argument
277 if (isl_tab_is_redundant(tab, level)) in can_select()
286 snap = isl_tab_snap(tab); in can_select()
287 if (isl_tab_select_facet(tab, level) < 0) in can_select()
290 if (tab->empty) { in can_select()
291 if (isl_tab_rollback(tab, snap) < 0) in can_select()
302 if (isl_tab_is_equality(tab, i)) in can_select()
304 else if (isl_tab_is_redundant(tab, i)) in can_select()
307 sgn = isl_tab_sign_of_max(tab, i); in can_select()
311 if (isl_tab_rollback(tab, snap) < 0) in can_select()
378 struct isl_tab *tab; in isl_basic_set_compute_vertices() local
413 tab = isl_tab_from_basic_set(bset, 0); in isl_basic_set_compute_vertices()
414 if (!tab) in isl_basic_set_compute_vertices()
416 tab->strict_redundant = 1; in isl_basic_set_compute_vertices()
418 if (tab->empty) { in isl_basic_set_compute_vertices()
421 isl_tab_free(tab); in isl_basic_set_compute_vertices()
444 snap[level] = isl_tab_snap(tab); in isl_basic_set_compute_vertices()
445 ok = can_select(bset, level, tab, facets, selected, in isl_basic_set_compute_vertices()
457 if (isl_tab_rollback(tab, snap[level]) < 0) in isl_basic_set_compute_vertices()
461 if (tab->n_dead == nvar) { in isl_basic_set_compute_vertices()
462 isl_bool added = add_vertex(&list, bset, tab); in isl_basic_set_compute_vertices()
479 isl_tab_free(tab); in isl_basic_set_compute_vertices()
491 isl_tab_free(tab); in isl_basic_set_compute_vertices()
514 * by "tab", i.e., check whether all constraints of "bset" are redundant.
517 struct isl_tab *tab) in bset_covers_tab() argument
521 if (!bset || !tab) in bset_covers_tab()
525 enum isl_ineq_type type = isl_tab_ineq_type(tab, bset->ineq[i]); in bset_covers_tab()
563 /* Can "tab" be intersected with "bset" without resulting in
567 static isl_bool can_intersect(struct isl_tab *tab, in can_intersect() argument
578 if (isl_tab_extend_cons(tab, bset->n_ineq) < 0) in can_intersect()
581 snap = isl_tab_snap(tab); in can_intersect()
586 type = isl_tab_ineq_type(tab, bset->ineq[i]); in can_intersect()
591 if (isl_tab_add_ineq(tab, bset->ineq[i]) < 0) in can_intersect()
595 if (isl_tab_detect_implicit_equalities(tab) < 0) in can_intersect()
597 if (tab->n_dead) { in can_intersect()
598 if (isl_tab_rollback(tab, snap) < 0) in can_intersect()
607 __isl_keep isl_vertices *vertices, struct isl_tab *tab, int *selection) in add_chamber() argument
619 snap = isl_tab_snap(tab); in add_chamber()
621 for (i = 0; i < tab->n_con && tab->con[i].frozen; ++i) in add_chamber()
622 tab->con[i].frozen = 0; in add_chamber()
625 if (isl_tab_detect_redundant(tab) < 0) in add_chamber()
628 c = isl_calloc_type(tab->mat->ctx, struct isl_chamber_list); in add_chamber()
631 c->c.vertices = isl_alloc_array(tab->mat->ctx, int, n_vertices); in add_chamber()
634 c->c.dom = isl_basic_set_copy(isl_tab_peek_bset(tab)); in add_chamber()
637 c->c.dom = isl_basic_set_update_from_tab(c->c.dom, tab); in add_chamber()
655 tab->con[i].frozen = 1; in add_chamber()
657 if (isl_tab_rollback(tab, snap) < 0) in add_chamber()
667 struct isl_tab *tab; /* A tableau representation of the facet */ member
678 isl_tab_free(todo->tab); in free_todo()
687 static struct isl_facet_todo *create_todo(struct isl_tab *tab, int con) in create_todo() argument
694 snap = isl_tab_snap(tab); in create_todo()
696 for (i = 0; i < tab->n_con && tab->con[i].frozen; ++i) in create_todo()
697 tab->con[i].frozen = 0; in create_todo()
700 if (isl_tab_detect_redundant(tab) < 0) in create_todo()
703 todo = isl_calloc_type(tab->mat->ctx, struct isl_facet_todo); in create_todo()
707 todo->constraint = isl_vec_alloc(tab->mat->ctx, 1 + tab->n_var); in create_todo()
710 isl_seq_neg(todo->constraint->el, tab->bmap->ineq[con], 1 + tab->n_var); in create_todo()
711 todo->bset = isl_basic_set_copy(isl_tab_peek_bset(tab)); in create_todo()
714 todo->bset = isl_basic_set_update_from_tab(todo->bset, tab); in create_todo()
720 todo->tab = isl_tab_dup(tab); in create_todo()
721 if (!todo->tab) in create_todo()
725 tab->con[i].frozen = 1; in create_todo()
727 if (isl_tab_rollback(tab, snap) < 0) in create_todo()
737 * by "tab" and collect them in "next".
739 static int init_todo(struct isl_facet_todo **next, struct isl_tab *tab) in init_todo() argument
745 snap = isl_tab_snap(tab); in init_todo()
747 for (i = 0; i < tab->n_con; ++i) { in init_todo()
748 if (tab->con[i].frozen) in init_todo()
750 if (tab->con[i].is_redundant) in init_todo()
753 if (isl_tab_select_facet(tab, i) < 0) in init_todo()
756 todo = create_todo(tab, i); in init_todo()
763 if (isl_tab_rollback(tab, snap) < 0) in init_todo()
794 * by "tab" and collect them in first->next, taking care to cancel
797 static int update_todo(struct isl_facet_todo *first, struct isl_tab *tab) in update_todo() argument
803 snap = isl_tab_snap(tab); in update_todo()
805 for (i = 0; i < tab->n_con; ++i) { in update_todo()
808 if (tab->con[i].frozen) in update_todo()
810 if (tab->con[i].is_redundant) in update_todo()
813 if (isl_tab_select_facet(tab, i) < 0) in update_todo()
816 todo = create_todo(tab, i); in update_todo()
831 if (isl_tab_rollback(tab, snap) < 0) in update_todo()
866 struct isl_tab *tab = NULL; in compute_chambers() local
883 tab = isl_tab_from_basic_set(bset, 1); in compute_chambers()
884 if (!tab) in compute_chambers()
887 if (isl_tab_freeze_constraint(tab, i) < 0) in compute_chambers()
891 snap = isl_tab_snap(tab); in compute_chambers()
893 sample = isl_tab_get_sample_value(tab); in compute_chambers()
901 selection[i] = can_intersect(tab, vertices->v[i].dom); in compute_chambers()
906 if (isl_tab_detect_redundant(tab) < 0) in compute_chambers()
909 if (add_chamber(&list, vertices, tab, selection) < 0) in compute_chambers()
913 if (init_todo(&todo, tab) < 0) in compute_chambers()
919 if (isl_tab_rollback(tab, snap) < 0) in compute_chambers()
922 if (isl_tab_add_ineq(tab, todo->constraint->el) < 0) in compute_chambers()
924 if (isl_tab_freeze_constraint(tab, tab->n_con - 1) < 0) in compute_chambers()
929 todo->tab); in compute_chambers()
934 selection[i] = can_intersect(tab, vertices->v[i].dom); in compute_chambers()
939 if (isl_tab_detect_redundant(tab) < 0) in compute_chambers()
942 if (add_chamber(&list, vertices, tab, selection) < 0) in compute_chambers()
946 if (update_todo(todo, tab) < 0) in compute_chambers()
957 isl_tab_free(tab); in compute_chambers()
972 isl_tab_free(tab); in compute_chambers()
974 if (!tab) in compute_chambers()
1120 struct isl_tab *tab; in tab_for_shifted_cone() local
1126 tab = isl_tab_alloc(bset->ctx, bset->n_eq + bset->n_ineq + 1, in tab_for_shifted_cone()
1128 if (!tab) in tab_for_shifted_cone()
1130 tab->rational = ISL_F_ISSET(bset, ISL_BASIC_SET_RATIONAL); in tab_for_shifted_cone()
1132 if (isl_tab_mark_empty(tab) < 0) in tab_for_shifted_cone()
1134 return tab; in tab_for_shifted_cone()
1144 if (isl_tab_add_eq(tab, c->el) < 0) in tab_for_shifted_cone()
1151 if (isl_tab_add_ineq(tab, c->el) < 0) in tab_for_shifted_cone()
1153 if (tab->empty) { in tab_for_shifted_cone()
1155 return tab; in tab_for_shifted_cone()
1161 if (isl_tab_add_ineq(tab, c->el) < 0) in tab_for_shifted_cone()
1165 return tab; in tab_for_shifted_cone()
1168 isl_tab_free(tab); in tab_for_shifted_cone()
1179 struct isl_tab *tab; in isl_basic_set_interior_point() local
1181 tab = tab_for_shifted_cone(bset); in isl_basic_set_interior_point()
1182 vec = isl_tab_get_sample_value(tab); in isl_basic_set_interior_point()
1183 isl_tab_free(tab); in isl_basic_set_interior_point()