1 /*
2 * Copyright 2011 Sven Verdoolaege
3 * Copyright 2012-2013 Ecole Normale Superieure
4 *
5 * Use of this software is governed by the MIT license
6 *
7 * Written by Sven Verdoolaege,
8 * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France
9 */
10
11 #include <isl_multi_macro.h>
12
13 /* Compute the gist of the parameter domain "dom1" with respect to "dom2".
14 *
15 * Since "dom2" may not be a parameter domain, explicitly convert it
16 * to a parameter domain first.
17 */
FN(MULTI (BASE),domain_gist_params)18 static __isl_give DOM *FN(MULTI(BASE),domain_gist_params)(DOM *dom1,
19 __isl_take DOM *dom2)
20 {
21 isl_set *params;
22
23 params = FN(DOM,params)(dom2);
24 dom1 = FN(DOM,gist_params)(dom1, params);
25
26 return dom1;
27 }
28
29 /* Compute the gist of "multi" with respect to the domain constraints
30 * of "context".
31 */
MULTI(BASE)32 __isl_give MULTI(BASE) *FN(MULTI(BASE),gist)(__isl_take MULTI(BASE) *multi,
33 __isl_take DOM *context)
34 {
35 if (FN(MULTI(BASE),check_compatible_domain)(multi, context) < 0)
36 context = FN(DOM,free)(context);
37 return FN(FN(MULTI(BASE),apply),DOMBASE)(multi, context, &FN(EL,gist),
38 &FN(DOM,gist),
39 &FN(MULTI(BASE),domain_gist_params));
40 }
41
42 /* Compute the gist of "multi" with respect to the parameter constraints
43 * of "context".
44 */
MULTI(BASE)45 __isl_give MULTI(BASE) *FN(MULTI(BASE),gist_params)(
46 __isl_take MULTI(BASE) *multi, __isl_take isl_set *context)
47 {
48 return FN(MULTI(BASE),apply_set)(multi, context, &FN(EL,gist_params),
49 &FN(DOM,gist_params), &FN(DOM,gist_params));
50 }
51