diff options
author | Sven Verdoolaege <skimo@kotnet.org> | 2011-12-06 09:17:03 +0100 |
---|---|---|
committer | Sven Verdoolaege <skimo@kotnet.org> | 2011-12-10 19:41:48 +0100 |
commit | ffbcd033895737a4068d2a4376aff3d0da434eef (patch) | |
tree | 379e81bc892c7bf663223cd24b75434bc624e91b /isl_space.c | |
parent | 0a2810732967eee50d8c55a371a28704d8a1ec17 (diff) | |
download | isl-ffbcd033895737a4068d2a4376aff3d0da434eef.tar.gz isl-ffbcd033895737a4068d2a4376aff3d0da434eef.tar.bz2 isl-ffbcd033895737a4068d2a4376aff3d0da434eef.zip |
add isl_space_map_from_domain_and_range
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Diffstat (limited to 'isl_space.c')
-rw-r--r-- | isl_space.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/isl_space.c b/isl_space.c index ae68013b..88b96268 100644 --- a/isl_space.c +++ b/isl_space.c @@ -1067,6 +1067,24 @@ error: return NULL; } +__isl_give isl_space *isl_space_map_from_domain_and_range( + __isl_take isl_space *domain, __isl_take isl_space *range) +{ + if (!domain || !range) + goto error; + if (!isl_space_is_set(domain)) + isl_die(isl_space_get_ctx(domain), isl_error_invalid, + "domain is not a set space", goto error); + if (!isl_space_is_set(range)) + isl_die(isl_space_get_ctx(range), isl_error_invalid, + "range is not a set space", goto error); + return isl_space_join(isl_space_reverse(domain), range); +error: + isl_space_free(domain); + isl_space_free(range); + return NULL; +} + static __isl_give isl_space *set_ids(__isl_take isl_space *dim, enum isl_dim_type type, unsigned first, unsigned n, __isl_take isl_id **ids) |