if (!tab)
goto error;
for (i = 0; i < context_ineq; ++i)
- tab->con[i].frozen = 1;
+ if (isl_tab_freeze_constraint(tab, i) < 0)
+ goto error;
tab = isl_tab_extend(tab, bset->n_ineq);
if (!tab)
goto error;
return 0;
}
+int isl_tab_freeze_constraint(struct isl_tab *tab, int con)
+{
+ struct isl_tab_var *var;
+
+ if (!tab)
+ return -1;
+
+ var = &tab->con[con];
+ if (var->frozen)
+ return 0;
+ if (var->index < 0)
+ return 0;
+ var->frozen = 1;
+
+ if (tab->need_undo)
+ return isl_tab_push_var(tab, isl_tab_undo_freeze, var);
+
+ return 0;
+}
+
/* Update the rows signs after a pivot of "row" and "col", with "row_sgn"
* the original sign of the pivot element.
* We only keep track of row signs during PILP solving and in this case
var->is_redundant = 0;
tab->n_redundant--;
break;
+ case isl_tab_undo_freeze:
+ var->frozen = 0;
+ break;
case isl_tab_undo_zero:
var->is_zero = 0;
if (!var->is_row)
break;
case isl_tab_undo_nonneg:
case isl_tab_undo_redundant:
+ case isl_tab_undo_freeze:
case isl_tab_undo_zero:
case isl_tab_undo_allocate:
case isl_tab_undo_relax:
isl_tab_undo_empty,
isl_tab_undo_nonneg,
isl_tab_undo_redundant,
+ isl_tab_undo_freeze,
isl_tab_undo_zero,
isl_tab_undo_allocate,
isl_tab_undo_relax,
struct isl_tab *isl_tab_add_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED;
struct isl_tab *isl_tab_add_valid_eq(struct isl_tab *tab, isl_int *eq) WARN_UNUSED;
+int isl_tab_freeze_constraint(struct isl_tab *tab, int con) WARN_UNUSED;
+
int isl_tab_is_equality(struct isl_tab *tab, int con);
int isl_tab_is_redundant(struct isl_tab *tab, int con);