isl_qpolynomial_move_dims: use isl_qpolynomial_domain_dim
[isl.git] / isl_multi_check_domain_templ.c
blob3a6c4e678636ab6ca1e49f1ba5fef23d48183d4d
1 /*
2 * Copyright 2017 Sven Verdoolaege
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege.
7 */
9 #include <isl_multi_macro.h>
11 /* Does the space of "domain" correspond to that of the domain of "multi"?
12 * The parameters do not need to be aligned.
14 static isl_bool FN(MULTI(BASE),compatible_domain)(
15 __isl_keep MULTI(BASE) *multi, __isl_keep DOM *domain)
17 isl_bool ok;
18 isl_space *space, *domain_space;
20 domain_space = FN(DOM,get_space)(domain);
21 space = FN(MULTI(BASE),get_space)(multi);
22 ok = isl_space_has_domain_tuples(domain_space, space);
23 isl_space_free(space);
24 isl_space_free(domain_space);
26 return ok;
29 /* Check that the space of "domain" corresponds to
30 * that of the domain of "multi", ignoring parameters.
32 static isl_stat FN(MULTI(BASE),check_compatible_domain)(
33 __isl_keep MULTI(BASE) *multi, __isl_keep DOM *domain)
35 isl_bool ok;
37 ok = FN(MULTI(BASE),compatible_domain)(multi, domain);
38 if (ok < 0)
39 return isl_stat_error;
40 if (!ok)
41 isl_die(FN(DOM,get_ctx)(domain), isl_error_invalid,
42 "incompatible spaces", return isl_stat_error);
44 return isl_stat_ok;