• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2014      INRIA Rocquencourt
3  *
4  * Use of this software is governed by the MIT license
5  *
6  * Written by Sven Verdoolaege,
7  * Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt,
8  * B.P. 105 - 78153 Le Chesnay, France
9  */
10 
11 #define xFN(TYPE,NAME) TYPE ## _ ## NAME
12 #define FN(TYPE,NAME) xFN(TYPE,NAME)
13 
14 /* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2"
15  * where the function value of "mpa1" lexicographically compares as "ORDER"
16  * to that of "mpa2".  "space" is the space of the result.
17  * The parameters of "mpa1" and "mpa2" are assumed to have been aligned.
18  *
19  * "mpa1" is in the given lexicographic order compared to "mpa2"
20  * if its i-th element is in that order compared to
21  * the i-th element of "mpa2" while all previous elements are
22  * pairwise equal.
23  */
FN(FN (isl_multi_pw_aff_lex,ORDER),map_on_space)24 static __isl_give isl_map *FN(FN(isl_multi_pw_aff_lex,ORDER),map_on_space)(
25 	__isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2,
26 	__isl_take isl_space *space)
27 {
28 	return isl_multi_pw_aff_lex_map_on_space(mpa1, mpa2,
29 					&FN(FN(isl_pw_aff,ORDER),map), space);
30 }
31 
32 /* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2"
33  * where the function value of "mpa1" lexicographically compares as "ORDER"
34  * to that of "mpa2".
35  */
FN(FN (isl_multi_pw_aff_lex,ORDER),map)36 __isl_give isl_map *FN(FN(isl_multi_pw_aff_lex,ORDER),map)(
37 	__isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2)
38 {
39 	return isl_multi_pw_aff_order_map(mpa1, mpa2,
40 			&FN(FN(isl_multi_pw_aff_lex,ORDER),map_on_space));
41 }
42 
43 /* Return the subset of "map" where the domain and the range
44  * have "mpa" values that lexicographically compare as "ORDER".
45  */
FN(FN (isl_map_lex,ORDER),at_multi_pw_aff)46 __isl_give isl_map *FN(FN(isl_map_lex,ORDER),at_multi_pw_aff)(
47 	__isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa)
48 {
49 	return isl_map_order_at_multi_pw_aff(map, mpa,
50 				&FN(FN(isl_multi_pw_aff_lex,ORDER),map));
51 }
52