isl 0.27
[isl.git] / isl_union_domain_reverse_templ.c
blob92d4d534450229d387ae2a249f231115003f08eb
1 /*
2 * Copyright 2023 Sven Verdoolaege
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege
7 */
9 /* Is "part" defined over a domain wrapping a binary relation?
11 static isl_bool FN(UNION,select_domain_is_wrapping_entry)(__isl_keep PART *part,
12 void *user)
14 return isl_space_domain_is_wrapping(FN(PART,peek_space)(part));
17 /* Wrapper around PART_domain_reverse for use
18 * as an isl_union_*_transform callback.
20 static __isl_give PART *FN(UNION,domain_reverse_entry)(__isl_take PART *part,
21 void *user)
23 return FN(PART,domain_reverse)(part);
26 /* For each base expression defined on a domain (A -> B),
27 * interchange A and B in the wrapped domain
28 * to obtain an expression on the domain (B -> A) and
29 * collect the results.
31 __isl_give UNION *FN(UNION,domain_reverse)(__isl_keep UNION *u)
33 S(UNION,transform_control) control = {
34 .filter = &FN(UNION,select_domain_is_wrapping_entry),
35 .fn = &FN(UNION,domain_reverse_entry),
38 return FN(UNION,transform)(u, &control);