22#include <isl_config.h>
58 for (i = 0; i <
n_var; ++i) {
154 unsigned off = 2 + tab->
M;
173 int, tab->
n_col + n_new);
184 switch (undo->
type) {
197 for (undo = tab->
top; undo && undo != &tab->
bottom; undo =
next) {
242 for (i = 0; i < tab->
n_var; ++i)
243 dup->var[i] = tab->
var[i];
247 for (i = 0; i < tab->
n_con; ++i)
248 dup->con[i] = tab->
con[i];
252 for (i = 0; i < tab->
n_col; ++i)
257 for (i = 0; i < tab->
n_row; ++i)
264 for (i = 0; i < tab->
n_row; ++i)
291 dup->strict_redundant = 0;
297 dup->bottom.next = NULL;
325 unsigned col1,
unsigned col2,
326 unsigned off,
unsigned r1,
unsigned r2,
unsigned d1,
unsigned d2)
338 for (i = 0; i < r1; ++i) {
342 mat1->row[i] + off + d1, col1 - d1);
347 for (i = 0; i < r2; ++i) {
351 mat2->row[i] + off, d2);
354 mat2->row[i] + off + d2, col2 - d2);
358 for (i = 0; i < row1 - r1; ++i) {
362 mat1->row[r1 + i] + off + d1, col1 - d1);
367 for (i = 0; i < row2 - r2; ++i) {
371 mat2->row[r2 + i] + off, d2);
374 mat2->row[r2 + i] + off + d2, col2 - d2);
384 unsigned r1,
unsigned r2,
unsigned d1,
unsigned d2)
386 if (
var->index == -1)
388 if (
var->is_row &&
var->index >= r1)
390 if (!
var->is_row &&
var->index >= d1)
398 unsigned row1,
unsigned col1,
399 unsigned r1,
unsigned r2,
unsigned d1,
unsigned d2)
401 if (
var->index == -1)
439 unsigned r1, r2, d1, d2;
464 tab1->
n_col, tab2->
n_col, off, r1, r2, d1, d2);
471 for (i = 0; i < tab1->
n_var; ++i) {
472 prod->
var[i] = tab1->
var[i];
475 for (i = 0; i < tab2->
n_var; ++i) {
485 for (i = 0; i < tab1->
n_con; ++i) {
486 prod->
con[i] = tab1->
con[i];
489 for (i = 0; i < tab2->
n_con; ++i) {
499 for (i = 0; i < tab1->
n_col; ++i) {
500 int pos = i < d1 ? i : i + d2;
503 for (i = 0; i < tab2->
n_col; ++i) {
504 int pos = i < d2 ? d1 + i : tab1->
n_col + i;
516 for (i = 0; i < tab1->
n_row; ++i) {
517 int pos = i < r1 ? i : i + r2;
520 for (i = 0; i < tab2->
n_row; ++i) {
521 int pos = i < r2 ? r1 + i : tab1->
n_row + i;
568 return &tab->
con[~i];
589 unsigned off = 2 + tab->
M;
610 unsigned off = 2 + tab->
M;
625 unsigned off = 2 + tab->
M;
665 unsigned off = 2 + tab->
M;
670 if (
var && j ==
var->index)
681 if (tsgn < 0 || (tsgn == 0 &&
707 int sgn,
int *row,
int *col)
718 for (j = tab->
n_dead; j < tab->n_col; ++j) {
724 if (c < 0 || tab->col_var[j] < tab->
col_var[c])
732 *row = r < 0 ?
var->index : r;
745 unsigned off = 2 + tab->
M;
757 for (i = tab->
n_dead; i < tab->n_col; ++i) {
852 for (i = 0; i < tab->
n_col; ++i)
959 var->is_redundant = 1;
962 if (tab->
row_var[row] >= 0 && !
var->is_nonneg) {
972 if (row != tab->
n_row - 1)
1048 unsigned off = 2 + tab->
M;
1058 for (i = 0; i < tab->
n_row; ++i) {
1133 unsigned off = 2 + tab->
M;
1145 for (j = 0; j < off - 1 + tab->
n_col; ++j) {
1146 if (j == off - 1 + col)
1152 for (i = 0; i < tab->
n_row; ++i) {
1158 for (j = 0; j < off - 1 + tab->
n_col; ++j) {
1159 if (j == off - 1 + col)
1162 mat->
row[i][1 + j], mat->
row[row][0]);
1164 mat->
row[i][off + col], mat->
row[row][1 + j]);
1167 mat->
row[i][off + col], mat->
row[row][off + col]);
1208 unsigned off = 2 + tab->
M;
1240 if (!
var->is_nonneg)
1353 if (row ==
var->index)
1391 if (
var->is_redundant)
1394 if (
var->is_nonneg) {
1396 pivot_var->
index == row) {
1406 if (
var->is_redundant)
1410 if (row ==
var->index)
1417 if (
var->is_redundant)
1420 if (pivot_var &&
var->is_nonneg) {
1467 if (
var->is_redundant)
1470 if (
var->is_nonneg) {
1472 pivot_var->
index == row) {
1482 if (
var->is_redundant)
1486 if (row ==
var->index) {
1496 if (
var->is_redundant)
1499 if (
var->is_nonneg) {
1527 if (row ==
var->index)
1538 unsigned off = 2 + tab->
M;
1571 if (col != tab->
n_col - 1)
1581 unsigned off = 2 + tab->
M;
1606 for (i = 0; i < tab->
n_var; ++i) {
1640 unsigned off = 2 + tab->
M;
1642 if (!
var->is_nonneg)
1644 "expecting non-negative variable",
1656 "row cannot have positive coefficients",
1713 "not enough room for new variable",
return -1);
1714 if (first > tab->
n_var)
1716 "invalid initial position",
return -1);
1718 for (i = tab->
n_var - 1; i >= first; --i) {
1719 tab->
var[i + 1] = tab->
var[i];
1740 if (first >= tab->
n_var)
1742 "invalid initial position",
return -1);
1746 for (i = first; i < tab->
n_var; ++i) {
1747 tab->
var[i] = tab->
var[i + 1];
1764 unsigned off = 2 + tab->
M;
1780 for (i = 0; i < tab->
n_row; ++i)
1818 unsigned off = 2 + tab->
M;
1830 for (i = 0; i < tab->
n_var; ++i) {
1843 1 + tab->
M + tab->
n_col);
1846 line[1 + i],
row[0]);
1847 if (tab->
M && i >= tab->
n_param && i < tab->n_var - tab->
n_div)
1882 if (col != tab->
n_col - 1)
1958 unsigned off = 2 + tab->
M;
1972 for (i = tab->
n_dead; i < tab->n_col; ++i)
2029 unsigned off = 2 + tab->
M;
2211 div_pos = 1 +
total - bmap->n_div + div;
2254 if (add_ineq(
user, ineq->
el) < 0)
2267 if (add_ineq(
user, ineq->
el) < 0)
2298 for (i = 0; i < tab->
n_var; ++i) {
2332 if (div->size != 1 + 1 + tab->
n_var)
2334 "unexpected size",
return -1);
2339 o_div = tab->
n_var - n_div;
2340 if (pos < o_div || pos > tab->
n_var)
2342 "invalid position",
return -1);
2455 for (i = 0; i < bset->n_eq; ++i) {
2461 tab =
add_eq(tab, bset->eq[i]);
2466 for (i = 0; i < bset->n_ineq; ++i) {
2505 if (!
var->is_nonneg)
2518 if (i == tab->
n_row)
2530 for (i = 0; i < tab->
n_var; ++i) {
2552 for (i = 0; i < tab->
n_var; ++i) {
2581 for (i = 0; i < tab->
n_var; ++i) {
2639 for (i = bmap->n_ineq - 1; i >= 0; --i) {
2645 if (bmap->n_eq != n_eq)
2667 "row unexpectedly moved to column",
2669 if (r + 1 != tab->
n_con)
2693 unsigned off = 2 + tab->
M;
2697 if (
var->is_redundant || !
var->is_nonneg)
2699 "expecting non-redundant non-negative variable",
2755 if (con < 0 || con >= tab->
n_con)
2789 "cannot relax redundant constraint",
return -1);
2792 "cannot relax dead constraint",
return -1);
2808 unsigned off = 2 + tab->
M;
2810 for (i = 0; i < tab->
n_row; ++i) {
2869 unsigned off = 2 + tab->
M;
2871 for (i = 0; i < tab->
n_row; ++i) {
2875 shift, tab->
mat->
row[i][off +
var->index]);
2896 if (!
var->is_nonneg)
2937 for (i = tab->
n_con - 1; i >= 0; --i) {
2984 var->marked = !
var->frozen &&
var->is_nonneg &&
2989 for (i = tab->
n_dead; i < tab->n_col; ++i) {
2991 var->marked = !
var->frozen &&
var->is_nonneg;
3042 "broken internal state",
return -1);
3062 tab->
con[con1] = tab->
con[con2];
3083 last = first +
n - 1;
3085 for (i = last; i > first; --i) {
3086 tab->
con[i] = tab->
con[i - 1];
3103 unsigned first,
unsigned n)
3107 if (first +
n > tab->
n_con || first +
n < first)
3113 for (i = first; i < tab->
n_con; ++i) {
3114 tab->
con[i] = tab->
con[i +
n];
3276 var->marked = !
var->frozen &&
var->is_nonneg;
3280 for (i = tab->
n_dead; i < tab->n_col; ++i) {
3282 var->marked = !
var->frozen &&
var->is_nonneg &&
3298 if (red && !
var->is_redundant)
3301 for (i = tab->
n_dead; i < tab->n_col; ++i) {
3371 if (row ==
var->index) {
3390 for (i = 0; i < tab->
n_con; ++i) {
3447 unsigned off = 2 + tab->
M;
3520 if (row ==
var->index)
3611 if (is_cst < 0 || is_cst)
3619 value ? value : &target, &tmp);
3639 if (var < 0 || var >= tab->
n_var)
3663 for (i = 0; i < tab->
n_var; ++i) {
3713 unsigned off = 2 + tab->
M;
3722 if (
var->is_nonneg) {
3730 for (i = 0; i < tab->
n_row; ++i) {
3773 var->is_redundant = 0;
3785 switch (undo->
type) {
3792 "not undoing last redundant row",
3827 "perform_undo_var called on invalid undo record",
3848 "manually restoring redundant constraints "
3849 "interferes with undo history",
3875 off = tab->
n_var - n_div;
3904 unsigned off = 2 + tab->
M;
3907 if (tab->
n_col && !extra)
3909 for (i = 0; i < tab->
n_col; ++i) {
3910 for (j = 0; j < tab->
n_col; ++j)
3911 if (tab->
col_var[i] == col_var[j])
3915 extra[n_extra++] = i;
3917 for (i = 0; i < tab->
n_col && n_extra > 0; ++i) {
3921 for (j = 0; j < tab->
n_col; ++j)
3922 if (col_var[i] == tab->
col_var[j])
3928 for (j = 0; j < n_extra; ++j)
3934 extra[j] = extra[--n_extra];
3970 switch (undo->
type) {
4022 for (undo = tab->
top; undo && undo != &tab->
bottom; undo =
next) {
4054 unsigned off = 2 + tab->
M;
4115 tab->
mat->
row[row][0]))) {
4156 tab->
n_con == bmap->n_eq + bmap->n_ineq,
goto error);
4180 FILE *out,
int indent)
4186 fprintf(out,
"%*snull tab\n", indent,
"");
4189 fprintf(out,
"%*sn_redundant: %d, n_dead: %d", indent,
"",
4190 tab->n_redundant, tab->n_dead);
4192 fprintf(out,
", rational");
4194 fprintf(out,
", empty");
4196 fprintf(out,
"%*s[", indent,
"");
4197 for (i = 0; i < tab->n_var; ++i) {
4199 fprintf(out, (i == tab->n_param ||
4200 i == tab->n_var - tab->n_div) ?
"; "
4202 fprintf(out,
"%c%d%s", tab->var[i].is_row ?
'r' :
'c',
4204 tab->var[i].is_zero ?
" [=0]" :
4205 tab->var[i].is_redundant ?
" [R]" :
"");
4207 fprintf(out,
"]\n");
4208 fprintf(out,
"%*s[", indent,
"");
4209 for (i = 0; i < tab->n_con; ++i) {
4212 fprintf(out,
"%c%d%s", tab->con[i].is_row ?
'r' :
'c',
4214 tab->con[i].is_zero ?
" [=0]" :
4215 tab->con[i].is_redundant ?
" [R]" :
"");
4217 fprintf(out,
"]\n");
4218 fprintf(out,
"%*s[", indent,
"");
4219 for (i = 0; i < tab->n_row; ++i) {
4220 const char *sign =
"";
4223 if (tab->row_sign) {
4233 fprintf(out,
"r%d: %d%s%s", i, tab->row_var[i],
4236 fprintf(out,
"]\n");
4237 fprintf(out,
"%*s[", indent,
"");
4238 for (i = 0; i < tab->n_col; ++i) {
4241 fprintf(out,
"c%d: %d%s", i, tab->col_var[i],
4244 fprintf(out,
"]\n");
4245 r = tab->mat->n_row;
4246 tab->mat->n_row = tab->n_row;
4247 c = tab->mat->n_col;
4248 tab->mat->n_col = 2 + tab->M + tab->n_col;
4250 tab->mat->n_row = r;
4251 tab->mat->n_col = c;
static RegisterPass< ScopPrinterWrapperPass > M("dot-scops", "Polly - Print Scops of function")
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_calloc_type(ctx, type)
#define ISL_FL_ISSET(l, f)
#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_F_ISSET(p, f)
#define isl_alloc_type(ctx, type)
#define isl_realloc_array(ctx, ptr, type, n)
isl_bool isl_bool_not(isl_bool b)
isl_stat isl_stat(*) void user)
int GMPQAPI() sgn(mp_rat op)
static __isl_give isl_ast_expr * var(struct isl_ast_add_term_data *data, enum isl_dim_type type, int pos)
int isl_ctx_next_operation(isl_ctx *ctx)
#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_gcd(r, i, j)
#define isl_int_neg(r, i)
#define isl_int_add_ui(r, i, j)
#define isl_int_add(r, i, j)
#define isl_int_abs_ge(i, j)
#define isl_int_addmul(r, i, j)
#define isl_int_is_divisible_by(i, j)
#define isl_int_set(r, i)
#define isl_int_cdiv_q(r, i, j)
#define isl_int_lcm(r, i, j)
#define isl_int_divexact(r, i, j)
#define isl_int_mul(r, i, j)
#define isl_int_set_si(r, i)
#define isl_int_sub_ui(r, i, j)
#define isl_int_fdiv_q(r, i, j)
#define isl_int_swap(i, j)
#define isl_int_sub(r, i, j)
#define isl_int_submul(r, i, j)
__isl_give dup(__isl_keep LIST(EL) *list)
__isl_give isl_basic_map * isl_basic_map_free_inequality(__isl_take isl_basic_map *bmap, unsigned n)
__isl_give isl_basic_map * isl_basic_map_add_ineq(__isl_take isl_basic_map *bmap, isl_int *ineq)
void isl_basic_map_inequality_to_equality(__isl_keep isl_basic_map *bmap, unsigned pos)
static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type)
__isl_give isl_basic_map * isl_basic_map_set_to_empty(__isl_take isl_basic_map *bmap)
__isl_give isl_basic_map * isl_basic_map_free_equality(__isl_take isl_basic_map *bmap, unsigned n)
int isl_basic_map_drop_inequality(__isl_keep isl_basic_map *bmap, unsigned pos)
__isl_give isl_basic_map * isl_basic_map_cow(__isl_take isl_basic_map *bmap)
__isl_give isl_basic_map * isl_basic_map_insert_div(__isl_take isl_basic_map *bmap, int pos, __isl_keep isl_vec *div)
__isl_give isl_basic_map * isl_basic_map_drop_div(__isl_take isl_basic_map *bmap, unsigned div)
#define ISL_BASIC_SET_RATIONAL
#define ISL_BASIC_MAP_EMPTY
__isl_give isl_basic_map * isl_basic_map_gauss(__isl_take isl_basic_map *bmap, int *progress)
#define ISL_BASIC_MAP_RATIONAL
isl_bool isl_basic_map_has_single_reference(__isl_keep isl_basic_map *bmap)
__isl_give isl_basic_map * isl_basic_map_gauss5(__isl_take isl_basic_map *bmap, int *progress, isl_stat(*swap)(unsigned a, unsigned b, void *user), isl_stat(*drop)(unsigned n, void *user), void *user)
__isl_give isl_mat * isl_mat_dup(__isl_keep isl_mat *mat)
void isl_seq_combine(isl_int *dst, isl_int m1, isl_int *src1, isl_int m2, isl_int *src2, 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_scale(isl_int *dst, isl_int *src, isl_int m, unsigned len)
void isl_seq_cpy(isl_int *dst, isl_int *src, unsigned len)
void isl_seq_normalize(struct isl_ctx *ctx, isl_int *p, unsigned len)
void isl_seq_neg(isl_int *dst, isl_int *src, unsigned len)
int isl_tab_detect_redundant(struct isl_tab *tab)
static isl_stat con_drop_entries(struct isl_tab *tab, unsigned first, unsigned n)
struct isl_tab * isl_tab_drop_sample(struct isl_tab *tab, int s)
int isl_tab_min_at_most_neg_one(struct isl_tab *tab, struct isl_tab_var *var)
void isl_tab_free(struct isl_tab *tab)
static isl_stat perform_undo(struct isl_tab *tab, struct isl_tab_undo *undo) WARN_UNUSED
static struct isl_tab * add_eq(struct isl_tab *tab, isl_int *eq)
static int sign_of_min(struct isl_tab *tab, struct isl_tab_var *var)
static isl_stat push_union(struct isl_tab *tab, enum isl_tab_undo_type type, union isl_tab_undo_val u) WARN_UNUSED
static int sign_of_max(struct isl_tab *tab, struct isl_tab_var *var)
static int at_least_one(struct isl_tab *tab, struct isl_tab_var *var)
static isl_stat close_row(struct isl_tab *tab, struct isl_tab_var *var, int temp_var) WARN_UNUSED
static int con_is_redundant(struct isl_tab *tab, struct isl_tab_var *var)
static struct isl_tab_var * select_marked(struct isl_tab *tab)
static isl_stat restore_last_redundant(struct isl_tab *tab)
static int reached(struct isl_tab *tab, struct isl_tab_var *var, int sgn, isl_int target, isl_int *tmp)
static struct isl_tab_var * var_from_col(struct isl_tab *tab, int i)
static void update_row_sign(struct isl_tab *tab, int row, int col, int row_sgn)
static int to_col(struct isl_tab *tab, struct isl_tab_var *var) WARN_UNUSED
isl_stat isl_tab_push_basis(struct isl_tab *tab)
void isl_tab_clear_undo(struct isl_tab *tab)
int isl_tab_insert_var(struct isl_tab *tab, int r)
isl_stat isl_tab_track_bset(struct isl_tab *tab, __isl_take isl_basic_set *bset)
struct isl_tab * isl_tab_init_samples(struct isl_tab *tab)
int isl_tab_extend_vars(struct isl_tab *tab, unsigned n_new)
struct isl_tab * isl_tab_product(struct isl_tab *tab1, struct isl_tab *tab2)
int isl_tab_add_sample(struct isl_tab *tab, __isl_take isl_vec *sample)
static isl_stat drop_last_con_in_row(struct isl_tab *tab, int r)
static void swap_cols(struct isl_tab *tab, int col1, int col2)
static enum isl_ineq_type separation_type(struct isl_tab *tab, unsigned row)
static isl_stat swap_eq(unsigned a, unsigned b, void *user)
int isl_tab_is_redundant(struct isl_tab *tab, int con)
struct isl_tab_var * isl_tab_var_from_row(struct isl_tab *tab, int i)
static int tab_is_manifestly_empty(struct isl_tab *tab)
static isl_bool get_constant(struct isl_tab *tab, struct isl_tab_var *var, isl_int *value)
static void drop_samples_since(struct isl_tab *tab, int n)
int isl_tab_mark_rational(struct isl_tab *tab)
static int var_insert_entry(struct isl_tab *tab, int first)
static int at_least_zero(struct isl_tab *tab, struct isl_tab_var *var)
isl_stat isl_tab_track_bmap(struct isl_tab *tab, __isl_take isl_basic_map *bmap)
isl_stat isl_tab_add_eq(struct isl_tab *tab, isl_int *eq)
static isl_bool is_constant(struct isl_tab *tab, struct isl_tab_var *var, isl_int *value)
static isl_stat ununrestrict(struct isl_tab *tab, struct isl_tab_var *var)
int isl_tab_mark_redundant(struct isl_tab *tab, int row)
isl_stat isl_tab_swap_constraints(struct isl_tab *tab, int con1, int con2)
static struct isl_vec * extract_integer_sample(struct isl_tab *tab)
__isl_keep isl_basic_set * isl_tab_peek_bset(struct isl_tab *tab)
int isl_tab_pivot(struct isl_tab *tab, int row, int col)
static isl_stat perform_undo_var(struct isl_tab *tab, struct isl_tab_undo *undo) WARN_UNUSED
static int var_drop_entry(struct isl_tab *tab, int first)
isl_stat isl_tab_push_callback(struct isl_tab *tab, struct isl_tab_callback *callback)
int isl_tab_relax(struct isl_tab *tab, int con)
static __isl_give isl_vec * ineq_for_div(__isl_keep isl_basic_map *bmap, unsigned div)
static int may_be_equality(struct isl_tab *tab, int row)
static isl_stat unrelax(struct isl_tab *tab, struct isl_tab_var *var) WARN_UNUSED
int isl_tab_add_row(struct isl_tab *tab, isl_int *line)
static struct isl_tab_var * var_from_index(struct isl_tab *tab, int i)
static int row_is_manifestly_non_integral(struct isl_tab *tab, int row)
static isl_stat drop_col(struct isl_tab *tab, int col)
struct isl_tab_undo * isl_tab_snap(struct isl_tab *tab)
isl_stat isl_tab_restore_redundant(struct isl_tab *tab)
static int min_is_manifestly_unbounded(struct isl_tab *tab, struct isl_tab_var *var)
int isl_tab_unrestrict(struct isl_tab *tab, int con)
int isl_tab_sign_of_max(struct isl_tab *tab, int con)
int isl_tab_is_equality(struct isl_tab *tab, int con)
int isl_tab_kill_col(struct isl_tab *tab, int col)
__isl_give isl_basic_set * isl_basic_set_update_from_tab(__isl_take isl_basic_set *bset, struct isl_tab *tab)
struct isl_tab * isl_tab_from_recession_cone(__isl_keep isl_basic_set *bset, int parametric)
static isl_stat add_div_constraints(struct isl_tab *tab, unsigned div, isl_stat(*add_ineq)(void *user, isl_int *), void *user)
isl_stat isl_tab_mark_empty(struct isl_tab *tab)
static isl_bool detect_constant_with_tmp(struct isl_tab *tab, struct isl_tab_var *var, isl_int *target, isl_int *tmp)
void isl_tab_dump(__isl_keep struct isl_tab *tab)
static isl_stat isl_tab_check_con(struct isl_tab *tab, int con)
static __isl_give isl_basic_map * gauss_if_shared(__isl_take isl_basic_map *bmap, struct isl_tab *tab)
static int row_sgn(struct isl_tab *tab, int row)
static void swap_rows(struct isl_tab *tab, int row1, int row2)
isl_stat isl_tab_add_ineq(struct isl_tab *tab, isl_int *ineq)
static __isl_give isl_mat * tab_mat_product(__isl_keep isl_mat *mat1, __isl_keep isl_mat *mat2, unsigned row1, unsigned row2, unsigned col1, unsigned col2, unsigned off, unsigned r1, unsigned r2, unsigned d1, unsigned d2)
static int row_is_big(struct isl_tab *tab, int row)
__isl_give isl_vec * isl_tab_get_sample_value(struct isl_tab *tab)
isl_ctx * isl_tab_get_ctx(struct isl_tab *tab)
static int row_at_most_neg_one(struct isl_tab *tab, int row)
int isl_tab_add_valid_eq(struct isl_tab *tab, isl_int *eq)
static void free_undo_record(struct isl_tab_undo *undo)
static isl_stat cut_to_hyperplane(struct isl_tab *tab, struct isl_tab_var *var)
static void free_undo(struct isl_tab *tab)
int isl_tab_add_div(struct isl_tab *tab, __isl_keep isl_vec *div)
isl_stat isl_tab_detect_constants(struct isl_tab *tab)
int isl_tab_sample_is_integer(struct isl_tab *tab)
isl_bool isl_tab_cone_is_bounded(struct isl_tab *tab)
__isl_give isl_basic_map * isl_tab_make_equalities_explicit(struct isl_tab *tab, __isl_take isl_basic_map *bmap)
isl_bool isl_tab_is_constant(struct isl_tab *tab, int var, isl_int *value)
static int row_is_neg(struct isl_tab *tab, int row)
static isl_stat drop_eq(unsigned n, void *user)
isl_bool isl_tab_need_undo(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)
static isl_bool var_reaches(struct isl_tab *tab, struct isl_tab_var *var, int sgn, isl_int target, isl_int *tmp)
static int max_is_manifestly_unbounded(struct isl_tab *tab, struct isl_tab_var *var)
static int pivot_row(struct isl_tab *tab, struct isl_tab_var *var, int sgn, int c)
isl_stat isl_tab_push(struct isl_tab *tab, enum isl_tab_undo_type type)
int isl_tab_shift_var(struct isl_tab *tab, int pos, isl_int shift)
static int to_row(struct isl_tab *tab, struct isl_tab_var *var, int sign) WARN_UNUSED
int isl_tab_row_is_redundant(struct isl_tab *tab, int row)
static int add_zero_row(struct isl_tab *tab)
enum isl_lp_result isl_tab_min(struct isl_tab *tab, isl_int *f, isl_int denom, isl_int *opt, isl_int *opt_denom, unsigned flags)
static void find_pivot(struct isl_tab *tab, struct isl_tab_var *var, struct isl_tab_var *skip_var, int sgn, int *row, int *col)
static void get_rounded_sample_value(struct isl_tab *tab, struct isl_tab_var *var, int sgn, isl_int *v)
static int restore_row(struct isl_tab *tab, struct isl_tab_var *var)
static void update_index2(struct isl_tab_var *var, unsigned row1, unsigned col1, unsigned r1, unsigned r2, unsigned d1, unsigned d2)
int isl_tab_detect_implicit_equalities(struct isl_tab *tab)
static void update_index1(struct isl_tab_var *var, unsigned r1, unsigned r2, unsigned d1, unsigned d2)
static int restore_basis(struct isl_tab *tab, int *col_var)
int isl_tab_insert_div(struct isl_tab *tab, int pos, __isl_keep isl_vec *div, isl_stat(*add_ineq)(void *user, isl_int *), void *user)
static void check_table(struct isl_tab *tab) __attribute__((unused))
__isl_give struct isl_tab * isl_tab_from_basic_map(__isl_keep isl_basic_map *bmap, int track)
__isl_give struct isl_tab * isl_tab_from_basic_set(__isl_keep isl_basic_set *bset, int track)
isl_stat isl_tab_push_var(struct isl_tab *tab, enum isl_tab_undo_type type, struct isl_tab_var *var)
static isl_stat drop_bmap_div(struct isl_tab *tab, int pos)
static int rotate_constraints(struct isl_tab *tab, int first, int n)
isl_stat isl_tab_save_samples(struct isl_tab *tab)
static isl_stat drop_row(struct isl_tab *tab, int row)
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)
static int row_is_manifestly_zero(struct isl_tab *tab, int row)
int isl_tab_allocate_con(struct isl_tab *tab)
static int update_con_after_move(struct isl_tab *tab, int i, int old)
static int div_is_nonneg(struct isl_tab *tab, __isl_keep isl_vec *div)
static void isl_tab_print_internal(__isl_keep struct isl_tab *tab, FILE *out, int indent)
int isl_tab_select_facet(struct isl_tab *tab, int con)
int isl_tab_extend_cons(struct isl_tab *tab, unsigned n_new)
__isl_give isl_basic_map * isl_basic_map_update_from_tab(__isl_take isl_basic_map *bmap, struct isl_tab *tab)
static int row_cmp(struct isl_tab *tab, int r1, int r2, int c, isl_int *t)
#define ISL_TAB_SAVE_DUAL
@ isl_tab_undo_saved_samples
@ isl_tab_undo_drop_sample
@ isl_tab_undo_saved_basis
@ isl_tab_undo_unrestrict
static enum isl_tab_row_sign row_sign(struct isl_tab *tab, struct isl_sol *sol, int row)
static __isl_give isl_union_map * total(__isl_take isl_union_map *umap, __isl_give isl_map *(*fn)(__isl_take isl_map *))
__isl_null isl_basic_map * isl_basic_map_free(__isl_take isl_basic_map *bmap)
isl_size isl_basic_map_dim(__isl_keep isl_basic_map *bmap, enum isl_dim_type type)
__isl_give isl_basic_map * isl_basic_map_copy(__isl_keep isl_basic_map *bmap)
void isl_basic_map_print_internal(__isl_keep isl_basic_map *bmap, FILE *out, int indent)
struct isl_basic_set isl_basic_set
void isl_mat_print_internal(__isl_keep isl_mat *mat, FILE *out, int indent)
__isl_give isl_mat * isl_mat_swap_cols(__isl_take isl_mat *mat, unsigned i, unsigned j)
__isl_give isl_mat * isl_mat_swap_rows(__isl_take isl_mat *mat, unsigned i, unsigned j)
__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_ctx * isl_mat_get_ctx(__isl_keep isl_mat *mat)
__isl_give isl_mat * isl_mat_extend(__isl_take isl_mat *mat, unsigned n_row, unsigned n_col)
__isl_give isl_mat * isl_mat_drop_cols(__isl_take isl_mat *mat, unsigned col, unsigned n)
isl_size isl_basic_set_dim(__isl_keep isl_basic_set *bset, enum isl_dim_type type)
isl_stat(* run)(struct isl_tab_callback *cb)
enum isl_tab_undo_type type
struct isl_tab_undo * next
struct isl_tab_undo bottom
struct isl_basic_map * bmap
struct isl_tab_undo * top
unsigned strict_redundant
enum isl_tab_row_sign * row_sign
struct isl_tab_callback * callback
__isl_null isl_vec * isl_vec_free(__isl_take isl_vec *vec)
__isl_give isl_vec * isl_vec_normalize(__isl_take isl_vec *vec)
__isl_give isl_vec * isl_vec_alloc(isl_ctx *ctx, unsigned size)