isl_qpolynomial_move_dims: use isl_qpolynomial_domain_dim
[isl.git] / isl_aff_lex_templ.c
blob9fbab61fb65127c2af5ae4244acc40d06ccc1812
1 /*
2 * Copyright 2014 INRIA Rocquencourt
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege,
7 * Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt,
8 * B.P. 105 - 78153 Le Chesnay, France
9 */
11 #define xFN(TYPE,NAME) TYPE ## _ ## NAME
12 #define FN(TYPE,NAME) xFN(TYPE,NAME)
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.
19 * "mpa1" is in the given lexicographic order compared to "mpa2"
20 * if, for some i, the i-th element of "mpa1" is in that order compared to
21 * the i-th element of "mpa2" while all previous elements are
22 * pairwise equal, where the order needs to be strict (not-equal)
23 * if i corresponds to anything but the last element.
24 * The strict version of "ORDER" is defined by "STRICT_ORDER",
25 * which is the same if "ORDER" itself is strict.
27 static __isl_give isl_map *FN(FN(isl_multi_pw_aff_lex,ORDER),map_on_space)(
28 __isl_keep isl_multi_pw_aff *mpa1, __isl_keep isl_multi_pw_aff *mpa2,
29 __isl_take isl_space *space)
31 return isl_multi_pw_aff_lex_map_on_space(mpa1, mpa2,
32 &FN(FN(isl_pw_aff,STRICT_ORDER),map),
33 &FN(FN(isl_pw_aff,ORDER),map), space);
36 /* Return a map containing pairs of elements in the domains of "mpa1" and "mpa2"
37 * where the function value of "mpa1" lexicographically compares as "ORDER"
38 * to that of "mpa2".
40 __isl_give isl_map *FN(FN(isl_multi_pw_aff_lex,ORDER),map)(
41 __isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2)
43 return isl_multi_pw_aff_order_map(mpa1, mpa2,
44 &FN(FN(isl_multi_pw_aff_lex,ORDER),map_on_space));
47 /* Return the subset of "map" where the domain and the range
48 * have "mpa" values that lexicographically compare as "ORDER".
50 __isl_give isl_map *FN(FN(isl_map_lex,ORDER),at_multi_pw_aff)(
51 __isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa)
53 return isl_map_order_at_multi_pw_aff(map, mpa,
54 &FN(FN(isl_multi_pw_aff_lex,ORDER),map));