summaryrefslogtreecommitdiff
path: root/isl_sample.c
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2012-11-20 11:19:00 +0100
committerSven Verdoolaege <skimo@kotnet.org>2012-11-20 11:28:17 +0100
commit89fbd2940acfcde9a18a9574ca0515cc1c4fae70 (patch)
treef930f99af6fffd525449bb250a62877166974b7c /isl_sample.c
parent8ee394c4db9afd801cc5f112c51f66d4ad039d51 (diff)
downloadisl-89fbd2940acfcde9a18a9574ca0515cc1c4fae70.tar.gz
isl-89fbd2940acfcde9a18a9574ca0515cc1c4fae70.tar.bz2
isl-89fbd2940acfcde9a18a9574ca0515cc1c4fae70.zip
isl_tab_sample: treat emptiness of tableau as error
We only modify the tableau through calls to isl_tab_add_valid_eq, which should never result in an empty tableau, given that the tableau was initially not empty. Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Diffstat (limited to 'isl_sample.c')
-rw-r--r--isl_sample.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/isl_sample.c b/isl_sample.c
index 197f0b51..d9cdc003 100644
--- a/isl_sample.c
+++ b/isl_sample.c
@@ -455,16 +455,16 @@ struct isl_vec *isl_tab_sample(struct isl_tab *tab)
reduced = 0;
while (level >= 0) {
- int empty = 0;
if (init) {
res = isl_tab_min(tab, tab->basis->row[1 + level],
ctx->one, &min->el[level], NULL, 0);
- if (res == isl_lp_empty)
- empty = 1;
- isl_assert(ctx, res != isl_lp_unbounded, goto error);
if (res == isl_lp_error)
goto error;
- if (!empty && isl_tab_sample_is_integer(tab))
+ if (res != isl_lp_ok)
+ isl_die(ctx, isl_error_internal,
+ "expecting bounded rational solution",
+ goto error);
+ if (isl_tab_sample_is_integer(tab))
break;
isl_seq_neg(tab->basis->row[1 + level] + 1,
tab->basis->row[1 + level] + 1, dim);
@@ -473,15 +473,15 @@ struct isl_vec *isl_tab_sample(struct isl_tab *tab)
isl_seq_neg(tab->basis->row[1 + level] + 1,
tab->basis->row[1 + level] + 1, dim);
isl_int_neg(max->el[level], max->el[level]);
- if (res == isl_lp_empty)
- empty = 1;
- isl_assert(ctx, res != isl_lp_unbounded, goto error);
if (res == isl_lp_error)
goto error;
- if (!empty && isl_tab_sample_is_integer(tab))
+ if (res != isl_lp_ok)
+ isl_die(ctx, isl_error_internal,
+ "expecting bounded rational solution",
+ goto error);
+ if (isl_tab_sample_is_integer(tab))
break;
- if (!empty && !reduced &&
- ctx->opt->gbr != ISL_GBR_NEVER &&
+ if (!reduced && ctx->opt->gbr != ISL_GBR_NEVER &&
isl_int_lt(min->el[level], max->el[level])) {
unsigned gbr_only_first;
if (ctx->opt->gbr == ISL_GBR_ONCE)
@@ -502,7 +502,7 @@ struct isl_vec *isl_tab_sample(struct isl_tab *tab)
} else
isl_int_add_ui(min->el[level], min->el[level], 1);
- if (empty || isl_int_gt(min->el[level], max->el[level])) {
+ if (isl_int_gt(min->el[level], max->el[level])) {
level--;
init = 0;
if (level >= 0)