~mmach/netext73/isl

« back to all changes in this revision

Viewing changes to closure.c

  • Committer: NetBit73
  • Date: 2018-06-06 06:57:54 UTC
  • Revision ID: netbit73@gmail.com-20180606065754-qw4x4wd2t39mx8wl
synchronizacja 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
        int exact;
 
12
 
 
13
        options = isl_options_new_with_defaults();
 
14
        assert(options);
 
15
        argc = isl_options_parse(options, argc, argv, ISL_ARG_ALL);
 
16
 
 
17
        ctx = isl_ctx_alloc_with_options(&isl_options_args, 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);
 
23
        if (!exact)
 
24
                p = isl_printer_print_str(p, "# NOT exact\n");
 
25
        p = isl_printer_print_map(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, "# coalesced\n");
 
30
        p = isl_printer_print_map(p, map);
 
31
        p = isl_printer_end_line(p);
 
32
        isl_map_free(map);
 
33
 
 
34
        isl_printer_free(p);
 
35
 
 
36
        isl_ctx_free(ctx);
 
37
 
 
38
        return 0;
 
39
}