#include "isl_map_private.h"
#include "isl_tab.h"
#include <isl/seq.h>
+#include <isl_config.h>
/*
* The implementation of tableaus in this file was inspired by Section 8
return isl_tab_pivot(tab, r, var->index);
}
+/* Check whether all variables that are marked as non-negative
+ * also have a non-negative sample value. This function is not
+ * called from the current code but is useful during debugging.
+ */
+static void check_table(struct isl_tab *tab) __attribute__ ((unused));
static void check_table(struct isl_tab *tab)
{
int i;
if (nonneg)
tab->var[r].is_nonneg = 1;
- tab->bmap = isl_basic_map_extend_dim(tab->bmap,
- isl_basic_map_get_dim(tab->bmap), 1, 0, 2);
+ tab->bmap = isl_basic_map_extend_space(tab->bmap,
+ isl_basic_map_get_space(tab->bmap), 1, 0, 2);
k = isl_basic_map_alloc_div(tab->bmap);
if (k < 0)
return -1;
static int may_be_equality(struct isl_tab *tab, int row)
{
- unsigned off = 2 + tab->M;
return tab->rational ? isl_int_is_zero(tab->mat->row[row][1])
: isl_int_lt(tab->mat->row[row][1],
tab->mat->row[row][0]);
static int perform_undo_var(struct isl_tab *tab, struct isl_tab_undo *undo)
{
struct isl_tab_var *var = var_from_index(tab, undo->u.var_index);
- switch(undo->type) {
+ switch (undo->type) {
case isl_tab_undo_nonneg:
var->is_nonneg = 0;
break;
break;
case isl_tab_undo_relax:
return unrelax(tab, var);
+ default:
+ isl_die(tab->mat->ctx, isl_error_internal,
+ "perform_undo_var called on invalid undo record",
+ return -1);
}
return 0;
int isl_tab_track_bmap(struct isl_tab *tab, __isl_take isl_basic_map *bmap)
{
+ bmap = isl_basic_map_cow(bmap);
if (!tab || !bmap)
goto error;
- isl_assert(tab->mat->ctx, tab->n_eq == bmap->n_eq, return -1);
+ isl_assert(tab->mat->ctx, tab->n_eq == bmap->n_eq, goto error);
isl_assert(tab->mat->ctx,
- tab->n_con == bmap->n_eq + bmap->n_ineq, return -1);
+ tab->n_con == bmap->n_eq + bmap->n_ineq, goto error);
tab->bmap = bmap;