2 * Copyright 2011 Sven Verdoolaege
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege.
10 #define EL CAT(isl_,BASE)
12 #define PW CAT(isl_pw_,BASE)
14 /* Print the body of a piecewise expression, i.e., a semicolon delimited
15 * sequence of expressions, each followed by constraints.
17 static __isl_give isl_printer
*FN(print_body_pw
,BASE
)(
18 __isl_take isl_printer
*p
, __isl_keep PW
*pw
)
23 return isl_printer_free(p
);
25 for (i
= 0; i
< pw
->n
; ++i
) {
30 p
= isl_printer_print_str(p
, "; ");
31 el
= FN(PW
,peek_base_at
)(pw
, i
);
32 p
= FN(print_body
,BASE
)(p
, el
);
33 space
= FN(EL
,get_domain_space
)(el
);
34 p
= print_disjuncts(set_to_map(pw
->p
[i
].set
), space
, p
, 0);
35 isl_space_free(space
);
40 /* Print a piecewise expression in isl format.
42 static __isl_give isl_printer
*FN(FN(print_pw
,BASE
),isl
)(
43 __isl_take isl_printer
*p
, __isl_keep PW
*pw
)
45 struct isl_print_space_data data
= { 0 };
48 return isl_printer_free(p
);
50 p
= print_param_tuple(p
, pw
->dim
, &data
);
51 p
= isl_printer_print_str(p
, "{ ");
52 p
= FN(print_body_pw
,BASE
)(p
, pw
);
53 p
= isl_printer_print_str(p
, " }");