From af58e7cc2e0d9742482a5dc13f378a11f2145e39 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 27 Sep 2008 19:53:26 +0200 Subject: [PATCH] export isl_set_eliminate_dims --- include/isl_set.h | 2 ++ isl_map.c | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/isl_set.h b/include/isl_set.h index fd097cf..fe289e2 100644 --- a/include/isl_set.h +++ b/include/isl_set.h @@ -144,6 +144,8 @@ struct isl_set *isl_set_lower_bound_dim(struct isl_set *set, unsigned dim, isl_int value); struct isl_basic_set *isl_basic_set_remove_dims(struct isl_basic_set *bset, unsigned first, unsigned n); +struct isl_set *isl_set_eliminate_dims(struct isl_set *set, + unsigned first, unsigned n); struct isl_set *isl_set_remove_dims(struct isl_set *set, unsigned first, unsigned n); diff --git a/isl_map.c b/isl_map.c index 9b26875..f35c45c 100644 --- a/isl_map.c +++ b/isl_map.c @@ -1343,8 +1343,11 @@ struct isl_basic_set *isl_basic_set_eliminate_vars( (struct isl_basic_map *)bset, pos, n); } -/* Project out n dimensions starting at first using Fourier-Motzkin */ -struct isl_set *isl_set_remove_dims(struct isl_set *set, +/* Eliminate the specified n dimensions starting at first from the + * constraints using Fourier-Motzkin, The dimensions themselves + * are not removed. + */ +struct isl_set *isl_set_eliminate_dims(struct isl_set *set, unsigned first, unsigned n) { int i; @@ -1363,13 +1366,21 @@ struct isl_set *isl_set_remove_dims(struct isl_set *set, if (!set->p[i]) goto error; } - set = isl_set_drop_dims(set, first, n); return set; error: isl_set_free(set); return NULL; } +/* Project out n dimensions starting at first using Fourier-Motzkin */ +struct isl_set *isl_set_remove_dims(struct isl_set *set, + unsigned first, unsigned n) +{ + set = isl_set_eliminate_dims(set, first, n); + set = isl_set_drop_dims(set, first, n); + return set; +} + /* 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) -- 2.7.4