add isl_multi_aff_lex_{le,ge}_set
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 19 Apr 2012 19:53:21 +0000 (21:53 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 2 Aug 2012 10:20:08 +0000 (12:20 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/aff.h
isl_aff.c

index c66d900..53725a8 100644 (file)
@@ -3546,6 +3546,18 @@ If the C<ls> argument of C<isl_multi_aff_lift> is not C<NULL>,
 then it is assigned the local space that lies at the basis of
 the lifting applied.
 
+       __isl_give isl_set *isl_multi_aff_lex_le_set(
+               __isl_take isl_multi_aff *ma1,
+               __isl_take isl_multi_aff *ma2);
+       __isl_give isl_set *isl_multi_aff_lex_ge_set(
+               __isl_take isl_multi_aff *ma1,
+               __isl_take isl_multi_aff *ma2);
+
+The function C<isl_multi_aff_lex_le_set> returns a set
+containing those elements in the shared domain space
+where C<ma1> is lexicographically smaller than or
+equal to C<ma2>.
+
 An expression can be read from input using
 
        #include <isl/aff.h>
index 72d56c1..4855cfe 100644 (file)
@@ -293,6 +293,11 @@ __isl_give isl_multi_aff *isl_multi_aff_gist(__isl_take isl_multi_aff *maff,
 __isl_give isl_multi_aff *isl_multi_aff_lift(__isl_take isl_multi_aff *maff,
        __isl_give isl_local_space **ls);
 
+__isl_give isl_set *isl_multi_aff_lex_le_set(__isl_take isl_multi_aff *ma1,
+       __isl_take isl_multi_aff *ma2);
+__isl_give isl_set *isl_multi_aff_lex_ge_set(__isl_take isl_multi_aff *ma1,
+       __isl_take isl_multi_aff *ma2);
+
 __isl_give isl_printer *isl_printer_print_multi_aff(__isl_take isl_printer *p,
        __isl_keep isl_multi_aff *maff);
 
index b29d29f..03516b1 100644 (file)
--- a/isl_aff.c
+++ b/isl_aff.c
@@ -2403,6 +2403,36 @@ __isl_give isl_multi_aff *isl_multi_aff_drop_dims(__isl_take isl_multi_aff *maff
        return maff;
 }
 
+/* Return the set of domain elements where "ma1" is lexicographically
+ * smaller than or equal to "ma2".
+ */
+__isl_give isl_set *isl_multi_aff_lex_le_set(__isl_take isl_multi_aff *ma1,
+       __isl_take isl_multi_aff *ma2)
+{
+       return isl_multi_aff_lex_ge_set(ma2, ma1);
+}
+
+/* Return the set of domain elements where "ma1" is lexicographically
+ * greater than or equal to "ma2".
+ */
+__isl_give isl_set *isl_multi_aff_lex_ge_set(__isl_take isl_multi_aff *ma1,
+       __isl_take isl_multi_aff *ma2)
+{
+       isl_space *space;
+       isl_map *map1, *map2;
+       isl_map *map, *ge;
+
+       map1 = isl_map_from_multi_aff(ma1);
+       map2 = isl_map_from_multi_aff(ma2);
+       map = isl_map_range_product(map1, map2);
+       space = isl_space_range(isl_map_get_space(map));
+       space = isl_space_domain(isl_space_unwrap(space));
+       ge = isl_map_lex_ge(space);
+       map = isl_map_intersect_range(map, isl_map_wrap(ge));
+
+       return isl_map_domain(map);
+}
+
 #undef PW
 #define PW isl_pw_multi_aff
 #undef EL