From 29e8ffff1f03cc86737611eef16527f9f477dd6a Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 24 Sep 2008 17:16:00 +0200 Subject: [PATCH] add isl_map_deltas --- include/isl_map.h | 1 + isl_map.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/include/isl_map.h b/include/isl_map.h index 3196a93..1e656d2 100644 --- a/include/isl_map.h +++ b/include/isl_map.h @@ -193,6 +193,7 @@ struct isl_map *isl_map_subtract(struct isl_map *map1, struct isl_map *map2); struct isl_map *isl_map_fix_input_si(struct isl_map *map, unsigned input, int value); struct isl_basic_set *isl_basic_map_deltas(struct isl_basic_map *bmap); +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); diff --git a/isl_map.c b/isl_map.c index 9a135a9..7e2c8da 100644 --- a/isl_map.c +++ b/isl_map.c @@ -2869,6 +2869,31 @@ error: return NULL; } +/* + * returns range - domain + */ +struct isl_set *isl_map_deltas(struct isl_map *map) +{ + int i; + struct isl_set *result; + + if (!map) + return NULL; + + isl_assert(map->ctx, map->n_in == map->n_out, goto error); + result = isl_set_alloc(map->ctx, map->nparam, map->n_in, map->n, map->flags); + if (!result) + goto error; + for (i = 0; i < map->n; ++i) + result = isl_set_add(result, + isl_basic_map_deltas(isl_basic_map_copy(map->p[i]))); + isl_map_free(map); + return result; +error: + isl_map_free(map); + return NULL; +} + /* If the only constraints a div d=floor(f/m) * appears in are its two defining constraints * -- 2.7.4