From 3fef898ccab1d0a03d09c66614107096b1c35d46 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Tue, 30 Aug 2016 18:00:44 +0200 Subject: [PATCH] make isl_space_has_equal_tuples public isl_space_has_equal_tuples is useful for library users to verify that functions such as isl_set_union or isl_map_intersect can be executed before actually calling them. Signed-off-by: Michael Kruse Signed-off-by: Sven Verdoolaege --- doc/user.pod | 8 ++++++++ include/isl/space.h | 2 ++ isl_space.c | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/user.pod b/doc/user.pod index e8ef924a..8dab36d0 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -952,6 +952,9 @@ Spaces can be compared using the following functions: #include isl_bool isl_space_is_equal(__isl_keep isl_space *space1, __isl_keep isl_space *space2); + isl_bool isl_space_has_equal_tuples( + __isl_keep isl_space *space1, + __isl_keep isl_space *space2); isl_bool isl_space_is_domain(__isl_keep isl_space *space1, __isl_keep isl_space *space2); isl_bool isl_space_is_range(__isl_keep isl_space *space1, @@ -976,6 +979,11 @@ In particular, it checks whether they have the same type (if they are not parameter spaces) in the sense of C and the same parameters in the same order. +C check whether two spaces have +the same tuples. In contrast to C, it does not check the +parameters. This is useful because many C functions align the +parameters before they perform their operations, such that equivalence +is not necessary. It is often useful to create objects that live in the same space as some other object. This can be accomplished diff --git a/include/isl/space.h b/include/isl/space.h index 3d509552..2ad53bdc 100644 --- a/include/isl/space.h +++ b/include/isl/space.h @@ -153,6 +153,8 @@ isl_bool isl_space_is_range(__isl_keep isl_space *space1, __isl_keep isl_space *space2); isl_bool isl_space_is_equal(__isl_keep isl_space *space1, __isl_keep isl_space *space2); +isl_bool isl_space_has_equal_tuples(__isl_keep isl_space *space1, + __isl_keep isl_space *space2); isl_bool isl_space_tuple_is_equal(__isl_keep isl_space *space1, enum isl_dim_type type1, __isl_keep isl_space *space2, enum isl_dim_type type2); diff --git a/isl_space.c b/isl_space.c index e3aeafe7..b4b88b7e 100644 --- a/isl_space.c +++ b/isl_space.c @@ -766,7 +766,7 @@ static __isl_keep isl_space *nested(__isl_keep isl_space *dim, /* Are the two spaces the same, apart from positions and names of parameters? */ -static isl_bool isl_space_has_equal_tuples(__isl_keep isl_space *space1, +isl_bool isl_space_has_equal_tuples(__isl_keep isl_space *space1, __isl_keep isl_space *space2) { if (!space1 || !space2) -- 2.11.4.GIT