From 0fa96fd91a9073f3c25e09b7f38e388510f85877 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 6 Nov 2013 11:13:24 +0100 Subject: [PATCH] add isl_multi_union_pw_aff_from_union_map Signed-off-by: Sven Verdoolaege --- doc/user.pod | 8 ++++++++ include/isl/aff.h | 3 +++ isl_aff.c | 15 +++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index 4fca431a..421de5d6 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -4334,7 +4334,11 @@ and the C is single-valued. In case of a conversion from an C to an C, these properties need to hold in each domain space. +A conversion to a C additionally +requires that the input is non-empty and involves only a single +range space. + #include __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_set( __isl_take isl_set *set); __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map( @@ -4347,6 +4351,10 @@ in each domain space. isl_union_pw_multi_aff_from_union_map( __isl_take isl_union_map *umap); + __isl_give isl_multi_union_pw_aff * + isl_multi_union_pw_aff_from_union_map( + __isl_take isl_union_map *umap); + =item * Deltas __isl_give isl_basic_set *isl_basic_map_deltas( diff --git a/include/isl/aff.h b/include/isl/aff.h index 4296fab7..83c78db4 100644 --- a/include/isl/aff.h +++ b/include/isl/aff.h @@ -839,6 +839,9 @@ __isl_give isl_multi_union_pw_aff * isl_multi_union_pw_aff_from_union_pw_multi_aff( __isl_take isl_union_pw_multi_aff *upma); +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_union_map( + __isl_take isl_union_map *umap); + __isl_give char *isl_multi_union_pw_aff_to_str( __isl_keep isl_multi_union_pw_aff *mupa); __isl_give isl_printer *isl_printer_print_multi_union_pw_aff( diff --git a/isl_aff.c b/isl_aff.c index 5337dade..76cd87bd 100644 --- a/isl_aff.c +++ b/isl_aff.c @@ -7646,3 +7646,18 @@ error: isl_union_pw_multi_aff_free(upma); return NULL; } + +/* Try and create an isl_multi_union_pw_aff that is equivalent + * to the given isl_union_map. + * The isl_union_map is required to be single-valued in each space. + * Moreover, it cannot be empty and all range spaces need to be the same. + * Otherwise, an error is produced. + */ +__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_union_map( + __isl_take isl_union_map *umap) +{ + isl_union_pw_multi_aff *upma; + + upma = isl_union_pw_multi_aff_from_union_map(umap); + return isl_multi_union_pw_aff_from_union_pw_multi_aff(upma); +} -- 2.11.4.GIT