From 4aea50a30f174b6d1bc23440d143ffc873084c1d Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 29 Jan 2014 15:17:16 +0100 Subject: [PATCH] add isl_space_domain_is_wrapping Signed-off-by: Sven Verdoolaege --- doc/user.pod | 3 +++ include/isl/space.h | 1 + isl_space.c | 15 ++++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/user.pod b/doc/user.pod index ba03df38..9e8b130f 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -2013,6 +2013,8 @@ The following functions check whether the space of the given #include int isl_space_is_wrapping( __isl_keep isl_space *space); + int isl_space_domain_is_wrapping( + __isl_keep isl_space *space); int isl_space_range_is_wrapping( __isl_keep isl_space *space); @@ -2027,6 +2029,7 @@ The following functions check whether the space of the given The input to C should be the space of a set, while that of +C and C should be the space of a relation. =item * Internal Product diff --git a/include/isl/space.h b/include/isl/space.h index fb9a38b3..4baf755f 100644 --- a/include/isl/space.h +++ b/include/isl/space.h @@ -123,6 +123,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_domain_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 *dim); __isl_give isl_space *isl_space_unwrap(__isl_take isl_space *dim); diff --git a/isl_space.c b/isl_space.c index 636a8703..6e58ec06 100644 --- a/isl_space.c +++ b/isl_space.c @@ -1,7 +1,7 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * Copyright 2010 INRIA Saclay - * Copyright 2014 Ecole Normale Superieure + * Copyright 2013-2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * @@ -1762,6 +1762,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 domain is a wrapped map space? + */ +int isl_space_domain_is_wrapping(__isl_keep isl_space *space) +{ + if (!space) + return -1; + + if (isl_space_is_set(space)) + return 0; + + return space->nested[0] != 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) -- 2.11.4.GIT