From a15a4b1c6c95e743648d125c403dd135a83d452f Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 5 Jan 2015 21:01:40 +0100 Subject: [PATCH] add isl_multi_pw_aff_lex_gt_map Signed-off-by: Sven Verdoolaege --- doc/user.pod | 3 +++ include/isl/aff.h | 2 ++ isl_aff.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index 0c27ad2d..0ba2e7bb 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -5894,6 +5894,9 @@ C function to each pair of elements in the two lists. __isl_give isl_map *isl_multi_pw_aff_lex_lt_map( __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2); + __isl_give isl_map *isl_multi_pw_aff_lex_gt_map( + __isl_take isl_multi_pw_aff *mpa1, + __isl_take isl_multi_pw_aff *mpa2); These functions return a map between domain elements of the arguments where the function values satisfy the given relation. diff --git a/include/isl/aff.h b/include/isl/aff.h index 8109e136..d05efc39 100644 --- a/include/isl/aff.h +++ b/include/isl/aff.h @@ -708,6 +708,8 @@ __isl_give isl_map *isl_multi_pw_aff_eq_map(__isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2); __isl_give isl_map *isl_multi_pw_aff_lex_lt_map( __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2); +__isl_give isl_map *isl_multi_pw_aff_lex_gt_map( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2); __isl_give isl_multi_pw_aff *isl_multi_pw_aff_read_from_str(isl_ctx *ctx, const char *str); diff --git a/isl_aff.c b/isl_aff.c index 848cd71b..ad3c5296 100644 --- a/isl_aff.c +++ b/isl_aff.c @@ -6938,6 +6938,34 @@ __isl_give isl_map *isl_multi_pw_aff_lex_lt_map( &isl_multi_pw_aff_lex_lt_map_on_space); } +/* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" + * where the function value of "mpa1" is lexicographically greater than that + * of "mpa2". "space" is the space of the result. + * The parameters of "mpa1" and "mpa2" are assumed to have been aligned. + * + * "mpa1" is greater than "mpa2" if its i-th element is greater + * than the i-th element of "mpa2" while all previous elements are + * pairwise equal. + */ +__isl_give isl_map *isl_multi_pw_aff_lex_gt_map_on_space( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2, + __isl_take isl_space *space) +{ + return isl_multi_pw_aff_lex_map_on_space(mpa1, mpa2, + &isl_pw_aff_gt_map, space); +} + +/* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2" + * where the function value of "mpa1" is lexicographically greater than that + * of "mpa2". + */ +__isl_give isl_map *isl_multi_pw_aff_lex_gt_map( + __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2) +{ + return isl_multi_pw_aff_order_map(mpa1, mpa2, + &isl_multi_pw_aff_lex_gt_map_on_space); +} + /* Compare two isl_affs. * * Return -1 if "aff1" is "smaller" than "aff2", 1 if "aff1" is "greater" -- 2.11.4.GIT