/* Drop all constraints in bset that involve any of the dimensions
* first to first+n-1.
*/
-static struct isl_basic_set *drop_constraints_involving
- (struct isl_basic_set *bset, unsigned first, unsigned n)
+__isl_give isl_basic_set *isl_basic_set_drop_constraints_involving(
+ __isl_take isl_basic_set *bset, unsigned first, unsigned n)
{
int i;
- if (!bset)
- return NULL;
+ if (n == 0)
+ return bset;
bset = isl_basic_set_cow(bset);
+ if (!bset)
+ return NULL;
+
for (i = bset->n_eq - 1; i >= 0; --i) {
if (isl_seq_first_non_zero(bset->eq[i] + 1 + first, n) == -1)
continue;
U = isl_mat_lin_to_aff(U);
bset = isl_basic_set_preimage(bset, isl_mat_copy(U));
- bset = drop_constraints_involving(bset, total - cone_dim, cone_dim);
+ bset = isl_basic_set_drop_constraints_involving(bset, total - cone_dim,
+ cone_dim);
bset = isl_basic_set_drop_dims(bset, total - cone_dim, cone_dim);
Q = isl_mat_lin_to_aff(Q);
struct isl_set *isl_map_underlying_set(struct isl_map *map);
struct isl_basic_map *isl_basic_map_overlying_set(struct isl_basic_set *bset,
struct isl_basic_map *like);
+__isl_give isl_basic_set *isl_basic_set_drop_constraints_involving(
+ __isl_take isl_basic_set *bset, unsigned first, unsigned n);
__isl_give isl_basic_set *isl_basic_set_drop(__isl_take isl_basic_set *bset,
enum isl_dim_type type, unsigned first, unsigned n);
struct isl_basic_map *isl_basic_map_drop(struct isl_basic_map *bmap,
return NULL;
}
-/* Drop all constraints in bset that involve any of the dimensions
- * first to first+n-1.
- */
-static struct isl_basic_set *drop_constraints_involving
- (struct isl_basic_set *bset, unsigned first, unsigned n)
-{
- int i;
-
- bset = isl_basic_set_cow(bset);
-
- if (!bset)
- return NULL;
-
- for (i = bset->n_ineq - 1; i >= 0; --i) {
- if (isl_seq_first_non_zero(bset->ineq[i] + 1 + first, n) == -1)
- continue;
- isl_basic_set_drop_inequality(bset, i);
- }
-
- return bset;
-}
-
/* Give a basic set "bset" with recession cone "cone", compute and
* return an integer point in bset, if any.
*
bset = isl_basic_set_preimage(bset, isl_mat_copy(U));
bounded = isl_basic_set_copy(bset);
- bounded = drop_constraints_involving(bounded, total - cone_dim, cone_dim);
+ bounded = isl_basic_set_drop_constraints_involving(bounded,
+ total - cone_dim, cone_dim);
bounded = isl_basic_set_drop_dims(bounded, total - cone_dim, cone_dim);
sample = sample_bounded(bounded);
if (!sample || sample->size == 0) {