2 #include <barvinok/options.h>
3 #include <barvinok/util.h>
8 enum order_sign
glpk_polyhedron_affine_sign(Polyhedron
*D
, Matrix
*T
,
9 struct barvinok_options
*options
)
14 enum lp_result
glpk_constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
15 enum lp_dir dir
, Value
*opt
)
20 enum lp_result
glpk_polyhedron_range(Polyhedron
*D
, Value
*obj
, Value denom
,
21 Value
*min
, Value
*max
,
22 struct barvinok_options
*options
)
28 #ifndef HAVE_LIBCDDGMP
29 enum order_sign
cdd_polyhedron_affine_sign(Polyhedron
*D
, Matrix
*T
,
30 struct barvinok_options
*options
)
35 enum order_sign
cddf_polyhedron_affine_sign(Polyhedron
*D
, Matrix
*T
,
36 struct barvinok_options
*options
)
41 enum lp_result
cdd_constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
42 enum lp_dir dir
, Value
*opt
)
47 enum lp_result
cddf_constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
48 enum lp_dir dir
, Value
*opt
)
53 enum lp_result
cdd_polyhedron_range(Polyhedron
*D
, Value
*obj
, Value denom
,
54 Value
*min
, Value
*max
,
55 struct barvinok_options
*options
)
60 enum lp_result
cddf_polyhedron_range(Polyhedron
*D
, Value
*obj
, Value denom
,
61 Value
*min
, Value
*max
,
62 struct barvinok_options
*options
)
69 enum lp_result
pip_constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
70 enum lp_dir dir
, Value
*opt
)
75 enum lp_result
pip_polyhedron_range(Polyhedron
*D
, Value
*obj
, Value denom
,
76 Value
*min
, Value
*max
,
77 struct barvinok_options
*options
)
83 enum order_sign
polyhedron_affine_sign(Polyhedron
*D
, Matrix
*T
,
84 struct barvinok_options
*options
)
86 if (options
->lp_solver
== BV_LP_POLYLIB
)
87 return PL_polyhedron_affine_sign(D
, T
, options
);
88 else if (options
->lp_solver
== BV_LP_GLPK
)
89 return glpk_polyhedron_affine_sign(D
, T
, options
);
90 else if (options
->lp_solver
== BV_LP_CDD
)
91 return cdd_polyhedron_affine_sign(D
, T
, options
);
92 else if (options
->lp_solver
== BV_LP_CDDF
)
93 return cddf_polyhedron_affine_sign(D
, T
, options
);
99 * Optimize (minimize or maximize depending on dir) the affine
100 * objective function obj (of length dimension+1), with denominator
101 * denom over the polyhedron specified by the constraints C.
102 * The result is returned in opt.
104 enum lp_result
constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
105 enum lp_dir dir
, Value
*opt
,
106 struct barvinok_options
*options
)
108 if (options
->lp_solver
== BV_LP_POLYLIB
)
109 return PL_constraints_opt(C
, obj
, denom
, dir
, opt
, options
->MaxRays
);
110 else if (options
->lp_solver
== BV_LP_GLPK
)
111 return glpk_constraints_opt(C
, obj
, denom
, dir
, opt
);
112 else if (options
->lp_solver
== BV_LP_CDD
)
113 return cdd_constraints_opt(C
, obj
, denom
, dir
, opt
);
114 else if (options
->lp_solver
== BV_LP_CDDF
)
115 return cddf_constraints_opt(C
, obj
, denom
, dir
, opt
);
116 else if (options
->lp_solver
== BV_LP_PIP
)
117 return pip_constraints_opt(C
, obj
, denom
, dir
, opt
);
123 * Optimize (minimize or maximize depending on dir) the affine
124 * objective function obj (of length dimension+1), with denominator
125 * denom over the polyhedron specified by P.
126 * The result is returned in opt.
128 enum lp_result
polyhedron_opt(Polyhedron
*P
, Value
*obj
, Value denom
,
129 enum lp_dir dir
, Value
*opt
,
130 struct barvinok_options
*options
)
132 if (options
->lp_solver
== BV_LP_POLYLIB
)
133 return PL_polyhedron_opt(P
, obj
, denom
, dir
, opt
);
136 Polyhedron_Matrix_View(P
, &M
, P
->NbConstraints
);
137 return constraints_opt(&M
, obj
, denom
, dir
, opt
, options
);
141 enum lp_result
polyhedron_range(Polyhedron
*D
, Value
*obj
, Value denom
,
142 Value
*min
, Value
*max
,
143 struct barvinok_options
*options
)
145 if (options
->lp_solver
== BV_LP_POLYLIB
)
146 return PL_polyhedron_range(D
, obj
, denom
, min
, max
, options
);
147 else if (options
->lp_solver
== BV_LP_GLPK
)
148 return glpk_polyhedron_range(D
, obj
, denom
, min
, max
, options
);
149 else if (options
->lp_solver
== BV_LP_CDD
)
150 return cdd_polyhedron_range(D
, obj
, denom
, min
, max
, options
);
151 else if (options
->lp_solver
== BV_LP_CDDF
)
152 return cddf_polyhedron_range(D
, obj
, denom
, min
, max
, options
);
153 else if (options
->lp_solver
== BV_LP_PIP
)
154 return pip_polyhedron_range(D
, obj
, denom
, min
, max
, options
);