struct isl_tab *tab;
int bounded;
+ if (!bset)
+ return -1;
+ if (isl_basic_set_fast_is_empty(bset))
+ return 1;
+
tab = isl_tab_from_recession_cone(bset);
bounded = isl_tab_cone_is_bounded(tab);
isl_tab_free(tab);
return bounded;
}
-static int isl_set_is_bounded(struct isl_set *set)
+int isl_set_is_bounded(__isl_keep isl_set *set)
{
int i;
isl_int_clear(opt);
- return res == isl_lp_ok ? 1 :
+ return (res == isl_lp_ok || res == isl_lp_empty) ? 1 :
res == isl_lp_unbounded ? 0 : -1;
}
for (j = 0; j < set->p[i]->n_eq; ++j) {
for (k = 0; k < 2; ++k) {
isl_seq_neg(set->p[i]->eq[j], set->p[i]->eq[j], 1+dim);
- add_bound(bset, data, set, i, set->p[i]->eq[j]);
+ bset = add_bound(bset, data, set, i, set->p[i]->eq[j]);
}
}
for (j = 0; j < set->p[i]->n_ineq; ++j)
- add_bound(bset, data, set, i, set->p[i]->ineq[j]);
+ bset = add_bound(bset, data, set, i, set->p[i]->ineq[j]);
return bset;
}