diff options
author | Sven Verdoolaege <skimo@kotnet.org> | 2011-08-30 14:25:50 +0200 |
---|---|---|
committer | Sven Verdoolaege <skimo@kotnet.org> | 2011-09-03 21:43:08 +0200 |
commit | 06b1a2451be611bff2b6601aa3821cf90292c590 (patch) | |
tree | abbfc949f69d7e51509031ccc0594160188904c9 | |
parent | d79280aa2a5661e5f31948a1ab93806167d12eca (diff) | |
download | isl-06b1a2451be611bff2b6601aa3821cf90292c590.tar.gz isl-06b1a2451be611bff2b6601aa3821cf90292c590.tar.bz2 isl-06b1a2451be611bff2b6601aa3821cf90292c590.zip |
add isl_space_is_domain
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
-rw-r--r-- | isl_space.c | 13 | ||||
-rw-r--r-- | isl_space_private.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/isl_space.c b/isl_space.c index d5f62ed9..5667dca6 100644 --- a/isl_space.c +++ b/isl_space.c @@ -1297,6 +1297,19 @@ int isl_space_is_equal(__isl_keep isl_space *dim1, __isl_keep isl_space *dim2) isl_space_tuple_match(dim1, isl_dim_out, dim2, isl_dim_out); } +/* Is space1 equal to the domain of space2? + */ +int isl_space_is_domain(__isl_keep isl_space *space1, + __isl_keep isl_space *space2) +{ + if (!space1 || !space2) + return -1; + if (!isl_space_is_set(space1)) + return 0; + return match(space1, isl_dim_param, space2, isl_dim_param) && + isl_space_tuple_match(space1, isl_dim_set, space2, isl_dim_in); +} + int isl_space_compatible(__isl_keep isl_space *dim1, __isl_keep isl_space *dim2) { diff --git a/isl_space_private.h b/isl_space_private.h index 74480d61..28cb5864 100644 --- a/isl_space_private.h +++ b/isl_space_private.h @@ -26,6 +26,9 @@ __isl_give isl_space *isl_space_underlying(__isl_take isl_space *dim, uint32_t isl_space_get_hash(__isl_keep isl_space *dim); +int isl_space_is_domain(__isl_keep isl_space *space1, + __isl_keep isl_space *space2); + __isl_give isl_space *isl_space_as_set_space(__isl_take isl_space *dim); unsigned isl_space_offset(__isl_keep isl_space *dim, enum isl_dim_type type); |