summaryrefslogtreecommitdiff
path: root/isl_options.c
blob: 70ebd2398d152743473360cbb5e4c9628335c216 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
 * Copyright 2008-2009 Katholieke Universiteit Leuven
 *
 * Use of this software is governed by the GNU LGPLv2.1 license
 *
 * Written by Sven Verdoolaege, K.U.Leuven, Departement
 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <isl/ctx.h>
#include <isl/options.h>
#include <isl/version.h>

struct isl_arg_choice isl_lp_solver_choice[] = {
	{"tab",		ISL_LP_TAB},
#ifdef ISL_PIPLIB
	{"pip",		ISL_LP_PIP},
#endif
	{0}
};

struct isl_arg_choice isl_ilp_solver_choice[] = {
	{"gbr",		ISL_ILP_GBR},
#ifdef ISL_PIPLIB
	{"pip",		ISL_ILP_PIP},
#endif
	{0}
};

struct isl_arg_choice isl_pip_solver_choice[] = {
	{"tab",		ISL_PIP_TAB},
#ifdef ISL_PIPLIB
	{"pip",		ISL_PIP_PIP},
#endif
	{0}
};

struct isl_arg_choice isl_pip_context_choice[] = {
	{"gbr",		ISL_CONTEXT_GBR},
	{"lexmin",	ISL_CONTEXT_LEXMIN},
	{0}
};

struct isl_arg_choice isl_gbr_choice[] = {
	{"never",	ISL_GBR_NEVER},
	{"once",	ISL_GBR_ONCE},
	{"always",	ISL_GBR_ALWAYS},
	{0}
};

struct isl_arg_choice isl_closure_choice[] = {
	{"isl",		ISL_CLOSURE_ISL},
	{"box",		ISL_CLOSURE_BOX},
	{0}
};

static struct isl_arg_choice bound[] = {
	{"bernstein",	ISL_BOUND_BERNSTEIN},
	{"range",	ISL_BOUND_RANGE},
	{0}
};

static struct isl_arg_flags bernstein_recurse[] = {
	{"none",	ISL_BERNSTEIN_FACTORS | ISL_BERNSTEIN_INTERVALS, 0},
	{"factors",	ISL_BERNSTEIN_FACTORS | ISL_BERNSTEIN_INTERVALS,
			ISL_BERNSTEIN_FACTORS},
	{"intervals",	ISL_BERNSTEIN_FACTORS | ISL_BERNSTEIN_INTERVALS,
			ISL_BERNSTEIN_INTERVALS},
	{"full",	ISL_BERNSTEIN_FACTORS | ISL_BERNSTEIN_INTERVALS,
			ISL_BERNSTEIN_FACTORS | ISL_BERNSTEIN_INTERVALS},
	{0}
};

static struct isl_arg_choice convex[] = {
	{"wrap",	ISL_CONVEX_HULL_WRAP},
	{"fm",		ISL_CONVEX_HULL_FM},
	{0}
};

static void print_version(void)
{
	printf("%s", isl_version());
}

struct isl_arg isl_options_arg[] = {
ISL_ARG_CHOICE(struct isl_options, lp_solver, 0, "lp-solver", \
	isl_lp_solver_choice,	ISL_LP_TAB, "lp solver to use")
ISL_ARG_CHOICE(struct isl_options, ilp_solver, 0, "ilp-solver", \
	isl_ilp_solver_choice,	ISL_ILP_GBR, "ilp solver to use")
ISL_ARG_CHOICE(struct isl_options, pip, 0, "pip", \
	isl_pip_solver_choice,	ISL_PIP_TAB, "pip solver to use")
ISL_ARG_CHOICE(struct isl_options, context, 0, "context", \
	isl_pip_context_choice,	ISL_CONTEXT_GBR,
	"how to handle the pip context tableau")
ISL_ARG_CHOICE(struct isl_options, gbr, 0, "gbr", \
	isl_gbr_choice,	ISL_GBR_ONCE,
	"how often to use generalized basis reduction")
ISL_ARG_CHOICE(struct isl_options, closure, 0, "closure", \
	isl_closure_choice,	ISL_CLOSURE_ISL,
	"closure operation to use")
ISL_ARG_BOOL(struct isl_options, gbr_only_first, 0, "gbr-only-first", 0,
	"only perform basis reduction in first direction")
ISL_ARG_CHOICE(struct isl_options, bound, 0, "bound", bound,
	ISL_BOUND_BERNSTEIN, "algorithm to use for computing bounds")
ISL_ARG_FLAGS(struct isl_options, bernstein_recurse, 0,
	"bernstein-recurse", bernstein_recurse, ISL_BERNSTEIN_FACTORS, NULL)
ISL_ARG_BOOL(struct isl_options, bernstein_triangulate, 0,
	"bernstein-triangulate", 1,
	"triangulate domains during Bernstein expansion")
ISL_ARG_BOOL(struct isl_options, pip_symmetry, 0, "pip-symmetry", 1,
	"detect simple symmetries in PIP input")
ISL_ARG_CHOICE(struct isl_options, convex, 0, "convex-hull", \
	convex,	ISL_CONVEX_HULL_WRAP, "convex hull algorithm to use")
ISL_ARG_VERSION(print_version)
ISL_ARG_END
};

ISL_ARG_DEF(isl_options, struct isl_options, isl_options_arg)