optionally (and by default) use bernstein expansion to compute bounds
[platform/upstream/isl.git] / isl_options.c
1 /*
2  * Copyright 2008-2009 Katholieke Universiteit Leuven
3  *
4  * Use of this software is governed by the GNU LGPLv2.1 license
5  *
6  * Written by Sven Verdoolaege, K.U.Leuven, Departement
7  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
8  */
9
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13
14 #include "isl_ctx.h"
15 #include "isl_options.h"
16
17 struct isl_arg_choice isl_lp_solver_choice[] = {
18         {"tab",         ISL_LP_TAB},
19 #ifdef ISL_PIPLIB
20         {"pip",         ISL_LP_PIP},
21 #endif
22         {0}
23 };
24
25 struct isl_arg_choice isl_ilp_solver_choice[] = {
26         {"gbr",         ISL_ILP_GBR},
27 #ifdef ISL_PIPLIB
28         {"pip",         ISL_ILP_PIP},
29 #endif
30         {0}
31 };
32
33 struct isl_arg_choice isl_pip_solver_choice[] = {
34         {"tab",         ISL_PIP_TAB},
35 #ifdef ISL_PIPLIB
36         {"pip",         ISL_PIP_PIP},
37 #endif
38         {0}
39 };
40
41 struct isl_arg_choice isl_pip_context_choice[] = {
42         {"gbr",         ISL_CONTEXT_GBR},
43         {"lexmin",      ISL_CONTEXT_LEXMIN},
44         {0}
45 };
46
47 struct isl_arg_choice isl_gbr_choice[] = {
48         {"never",       ISL_GBR_NEVER},
49         {"once",        ISL_GBR_ONCE},
50         {"always",      ISL_GBR_ALWAYS},
51         {0}
52 };
53
54 struct isl_arg_choice isl_closure_choice[] = {
55         {"isl",         ISL_CLOSURE_ISL},
56         {"omega",       ISL_CLOSURE_OMEGA},
57         {0}
58 };
59
60 static struct isl_arg_choice bound[] = {
61         {"bernstein",   ISL_BOUND_BERNSTEIN},
62         {"range",       ISL_BOUND_RANGE},
63         {0}
64 };
65
66 static struct isl_arg_flags bernstein_recurse[] = {
67         {"none",        ISL_BERNSTEIN_FACTORS | ISL_BERNSTEIN_INTERVALS, 0},
68         {"factors",     ISL_BERNSTEIN_FACTORS | ISL_BERNSTEIN_INTERVALS,
69                         ISL_BERNSTEIN_FACTORS},
70         {"intervals",   ISL_BERNSTEIN_FACTORS | ISL_BERNSTEIN_INTERVALS,
71                         ISL_BERNSTEIN_INTERVALS},
72         {"full",        ISL_BERNSTEIN_FACTORS | ISL_BERNSTEIN_INTERVALS,
73                         ISL_BERNSTEIN_FACTORS | ISL_BERNSTEIN_INTERVALS},
74         {0}
75 };
76
77 struct isl_arg isl_options_arg[] = {
78 ISL_ARG_CHOICE(struct isl_options, lp_solver, 0, "lp-solver", \
79         isl_lp_solver_choice,   ISL_LP_TAB, "lp solver to use")
80 ISL_ARG_CHOICE(struct isl_options, ilp_solver, 0, "ilp-solver", \
81         isl_ilp_solver_choice,  ISL_ILP_GBR, "ilp solver to use")
82 ISL_ARG_CHOICE(struct isl_options, pip, 0, "pip", \
83         isl_pip_solver_choice,  ISL_PIP_TAB, "pip solver to use")
84 ISL_ARG_CHOICE(struct isl_options, context, 0, "context", \
85         isl_pip_context_choice, ISL_CONTEXT_GBR,
86         "how to handle the pip context tableau")
87 ISL_ARG_CHOICE(struct isl_options, gbr, 0, "gbr", \
88         isl_gbr_choice, ISL_GBR_ONCE,
89         "how often to use generalized basis reduction")
90 ISL_ARG_CHOICE(struct isl_options, closure, 0, "closure", \
91         isl_closure_choice,     ISL_CLOSURE_ISL,
92         "closure operation to use")
93 ISL_ARG_BOOL(struct isl_options, gbr_only_first, 0, "gbr-only-first", 0,
94         "only perform basis reduction in first direction")
95 ISL_ARG_CHOICE(struct isl_options, bound, 0, "bound", bound,
96         ISL_BOUND_BERNSTEIN, "algorithm to use for computing bounds")
97 ISL_ARG_FLAGS(struct isl_options, bernstein_recurse, 0,
98         "bernstein-recurse", bernstein_recurse, ISL_BERNSTEIN_FACTORS, NULL)
99 ISL_ARG_END
100 };
101
102 ISL_ARG_DEF(isl_options, struct isl_options, isl_options_arg)