export isl_set_eliminate_dims
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 27 Sep 2008 17:53:26 +0000 (19:53 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 13 Oct 2008 22:39:34 +0000 (00:39 +0200)
include/isl_set.h
isl_map.c

index fd097cf..fe289e2 100644 (file)
@@ -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);
 
index 9b26875..f35c45c 100644 (file)
--- 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)