From 083236b5f37755ac9857c50c5cc6e197b386f639 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 8 Aug 2013 14:40:44 +0200 Subject: [PATCH] add isl_space_is_wrapping Signed-off-by: Sven Verdoolaege --- doc/user.pod | 3 +++ include/isl/space.h | 1 + isl_space.c | 13 +++++++++++++ 3 files changed, 17 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index b956f351..dd16c117 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -911,6 +911,8 @@ such nested spaces. #include int isl_space_is_wrapping(__isl_keep isl_space *space); + int isl_space_range_is_wrapping( + __isl_keep isl_space *space); __isl_give isl_space *isl_space_wrap(__isl_take isl_space *space); __isl_give isl_space *isl_space_unwrap(__isl_take isl_space *space); __isl_give isl_space *isl_space_product(__isl_take isl_space *space1, @@ -924,6 +926,7 @@ such nested spaces. The input to C and C should be the space of a set, while that of +C and C should be the space of a relation. Conversely, the output of C is the space of a relation, while that of C is the space of a set. diff --git a/include/isl/space.h b/include/isl/space.h index 6c3b57ab..0084108e 100644 --- a/include/isl/space.h +++ b/include/isl/space.h @@ -119,6 +119,7 @@ __isl_give isl_space *isl_space_align_params(__isl_take isl_space *dim1, __isl_take isl_space *dim2); int isl_space_is_wrapping(__isl_keep isl_space *dim); +int isl_space_range_is_wrapping(__isl_keep isl_space *space); __isl_give isl_space *isl_space_wrap(__isl_take isl_space *dim); __isl_give isl_space *isl_space_unwrap(__isl_take isl_space *dim); diff --git a/isl_space.c b/isl_space.c index 9d60fb33..c39f4aee 100644 --- a/isl_space.c +++ b/isl_space.c @@ -1683,6 +1683,19 @@ int isl_space_is_wrapping(__isl_keep isl_space *dim) return dim->nested[1] != NULL; } +/* Is "space" the space of a map where the range is a wrapped map space? + */ +int isl_space_range_is_wrapping(__isl_keep isl_space *space) +{ + if (!space) + return -1; + + if (isl_space_is_set(space)) + return 0; + + return space->nested[1] != NULL; +} + __isl_give isl_space *isl_space_wrap(__isl_take isl_space *dim) { isl_space *wrap; -- 2.11.4.GIT