struct isl_set *isl_map_deltas(struct isl_map *map);
struct isl_set *isl_map_range(struct isl_map *map);
struct isl_basic_map *isl_map_affine_hull(struct isl_map *map);
+struct isl_map *isl_map_remove(struct isl_map *map,
+ enum isl_dim_type type, unsigned first, unsigned n);
struct isl_map *isl_map_remove_inputs(struct isl_map *map,
unsigned first, unsigned n);
return NULL;
}
-/* Project out n inputs starting at first using Fourier-Motzkin */
-struct isl_map *isl_map_remove_inputs(struct isl_map *map,
- unsigned first, unsigned n)
+struct isl_map *isl_map_remove(struct isl_map *map,
+ enum isl_dim_type type, unsigned first, unsigned n)
{
int i;
unsigned nparam;
map = isl_map_cow(map);
if (!map)
return NULL;
- nparam = isl_map_n_param(map);
- isl_assert(map->ctx, first+n <= isl_map_n_in(map), goto error);
+ isl_assert(map->ctx, first + n <= isl_map_dim(map, type), goto error);
for (i = 0; i < map->n; ++i) {
map->p[i] = isl_basic_map_eliminate_vars(map->p[i],
- nparam + first, n);
+ isl_basic_map_offset(map->p[i], type) - 1 + first, n);
if (!map->p[i])
goto error;
}
- map = isl_map_drop_inputs(map, first, n);
+ map = isl_map_drop(map, type, first, n);
return map;
error:
isl_map_free(map);
return NULL;
}
+/* Project out n inputs starting at first using Fourier-Motzkin */
+struct isl_map *isl_map_remove_inputs(struct isl_map *map,
+ unsigned first, unsigned n)
+{
+ return isl_map_remove(map, isl_dim_in, first, n);
+}
+
/* Project out n dimensions starting at first using Fourier-Motzkin */
struct isl_basic_set *isl_basic_set_remove_dims(struct isl_basic_set *bset,
unsigned first, unsigned n)
struct isl_set *set, unsigned first, unsigned n);
struct isl_map *isl_map_drop_inputs(
struct isl_map *map, unsigned first, unsigned n);
+struct isl_map *isl_map_drop(struct isl_map *map,
+ enum isl_dim_type type, unsigned first, unsigned n);
struct isl_map *isl_map_remove_empty_parts(struct isl_map *map);
struct isl_set *isl_set_remove_empty_parts(struct isl_set *set);
return isl_basic_map_drop(bmap, isl_dim_in, first, n);
}
-struct isl_map *isl_map_drop_inputs(
- struct isl_map *map, unsigned first, unsigned n)
+struct isl_map *isl_map_drop(struct isl_map *map,
+ enum isl_dim_type type, unsigned first, unsigned n)
{
int i;
if (!map)
goto error;
- isl_assert(map->ctx, first + n <= map->dim->n_in, goto error);
+ isl_assert(map->ctx, first + n <= isl_map_dim(map, type), goto error);
if (n == 0)
return map;
map = isl_map_cow(map);
if (!map)
goto error;
- map->dim = isl_dim_drop_inputs(map->dim, first, n);
+ map->dim = isl_dim_drop(map->dim, type, first, n);
if (!map->dim)
goto error;
for (i = 0; i < map->n; ++i) {
- map->p[i] = isl_basic_map_drop_inputs(map->p[i], first, n);
+ map->p[i] = isl_basic_map_drop(map->p[i], type, first, n);
if (!map->p[i])
goto error;
}
return NULL;
}
+struct isl_map *isl_map_drop_inputs(
+ struct isl_map *map, unsigned first, unsigned n)
+{
+ return isl_map_drop(map, isl_dim_in, first, n);
+}
+
/*
* We don't cow, as the div is assumed to be redundant.
*/