isl 0.27
[isl.git] / isl_multi_param_templ.c
blobeab93548933f9f977153208289258178dc4bae47
1 /*
2 * Use of this software is governed by the MIT license
4 * Written by Sven Verdoolaege
5 */
7 #include <isl_multi_macro.h>
9 /* Does the multiple expression "multi" depend in any way
10 * on the parameter with identifier "id"?
12 isl_bool FN(MULTI(BASE),involves_param_id)(__isl_keep MULTI(BASE) *multi,
13 __isl_keep isl_id *id)
15 int i;
16 int pos;
18 if (!multi || !id)
19 return isl_bool_error;
20 if (multi->n == 0)
21 return isl_bool_false;
22 pos = FN(MULTI(BASE),find_dim_by_id)(multi, isl_dim_param, id);
23 if (pos < 0)
24 return isl_bool_false;
26 for (i = 0; i < multi->n; ++i) {
27 isl_bool involved = FN(EL,involves_param_id)(multi->u.p[i], id);
28 if (involved < 0 || involved)
29 return involved;
32 return isl_bool_false;
35 /* Does the multiple expression "multi" depend in any way
36 * on any of the parameters with identifiers in "list"?
38 isl_bool FN(MULTI(BASE),involves_param_id_list)(__isl_keep MULTI(BASE) *multi,
39 __isl_keep isl_id_list *list)
41 int i;
42 isl_size n;
44 n = isl_id_list_size(list);
45 if (n < 0)
46 return isl_bool_error;
47 for (i = 0; i < n; ++i) {
48 isl_bool involves;
49 isl_id *id;
51 id = isl_id_list_get_at(list, i);
52 involves = FN(MULTI(BASE),involves_param_id)(multi, id);
53 isl_id_free(id);
55 if (involves < 0 || involves)
56 return involves;
59 return isl_bool_false;