1 | #include <assert.h> |
2 | #include <isl/map.h> |
3 | #include <isl/options.h> |
4 | |
5 | int main(int argc, char **argv) |
6 | { |
7 | struct isl_ctx *ctx; |
8 | struct isl_map *map; |
9 | struct isl_options *options; |
10 | isl_printer *p; |
11 | isl_bool exact; |
12 | |
13 | options = isl_options_new_with_defaults(); |
14 | assert(options); |
15 | argc = isl_options_parse(opt: options, argc, argv, ISL_ARG_ALL); |
16 | |
17 | ctx = isl_ctx_alloc_with_options(args: &isl_options_args, opt: options); |
18 | |
19 | p = isl_printer_to_file(ctx, stdout); |
20 | |
21 | map = isl_map_read_from_file(ctx, stdin); |
22 | map = isl_map_transitive_closure(map, exact: &exact); |
23 | if (!exact) |
24 | p = isl_printer_print_str(p, s: "# NOT exact\n" ); |
25 | p = isl_printer_print_map(printer: p, map); |
26 | p = isl_printer_end_line(p); |
27 | map = isl_map_compute_divs(map); |
28 | map = isl_map_coalesce(map); |
29 | p = isl_printer_print_str(p, s: "# coalesced\n" ); |
30 | p = isl_printer_print_map(printer: p, map); |
31 | p = isl_printer_end_line(p); |
32 | isl_map_free(map); |
33 | |
34 | isl_printer_free(printer: p); |
35 | |
36 | isl_ctx_free(ctx); |
37 | |
38 | return 0; |
39 | } |
40 | |