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
)
68 enum order_sign
polyhedron_affine_sign(Polyhedron
*D
, Matrix
*T
,
69 struct barvinok_options
*options
)
71 if (options
->lp_solver
== BV_LP_POLYLIB
)
72 return PL_polyhedron_affine_sign(D
, T
, options
);
73 else if (options
->lp_solver
== BV_LP_GLPK
)
74 return glpk_polyhedron_affine_sign(D
, T
, options
);
75 else if (options
->lp_solver
== BV_LP_CDD
)
76 return cdd_polyhedron_affine_sign(D
, T
, options
);
77 else if (options
->lp_solver
== BV_LP_CDDF
)
78 return cddf_polyhedron_affine_sign(D
, T
, options
);
84 * Optimize (minimize or maximize depending on dir) the affine
85 * objective function obj (of length dimension+1), with denominator
86 * denom over the polyhedron specified by the constraints C.
87 * The result is returned in opt.
89 enum lp_result
constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
90 enum lp_dir dir
, Value
*opt
,
91 struct barvinok_options
*options
)
93 if (options
->lp_solver
== BV_LP_POLYLIB
)
94 return PL_constraints_opt(C
, obj
, denom
, dir
, opt
, options
->MaxRays
);
95 else if (options
->lp_solver
== BV_LP_GLPK
)
96 return glpk_constraints_opt(C
, obj
, denom
, dir
, opt
);
97 else if (options
->lp_solver
== BV_LP_CDD
)
98 return cdd_constraints_opt(C
, obj
, denom
, dir
, opt
);
99 else if (options
->lp_solver
== BV_LP_CDDF
)
100 return cddf_constraints_opt(C
, obj
, denom
, dir
, opt
);
101 else if (options
->lp_solver
== BV_LP_PIP
)
102 return pip_constraints_opt(C
, obj
, denom
, dir
, opt
);
108 * Optimize (minimize or maximize depending on dir) the affine
109 * objective function obj (of length dimension+1), with denominator
110 * denom over the polyhedron specified by P.
111 * The result is returned in opt.
113 enum lp_result
polyhedron_opt(Polyhedron
*P
, Value
*obj
, Value denom
,
114 enum lp_dir dir
, Value
*opt
,
115 struct barvinok_options
*options
)
117 if (options
->lp_solver
== BV_LP_POLYLIB
)
118 return PL_polyhedron_opt(P
, obj
, denom
, dir
, opt
);
121 Polyhedron_Matrix_View(P
, &M
, P
->NbConstraints
);
122 return constraints_opt(&M
, obj
, denom
, dir
, opt
, options
);
126 enum lp_result
polyhedron_range(Polyhedron
*D
, Value
*obj
, Value denom
,
127 Value
*min
, Value
*max
,
128 struct barvinok_options
*options
)
130 if (options
->lp_solver
== BV_LP_POLYLIB
)
131 return PL_polyhedron_range(D
, obj
, denom
, min
, max
, options
);
132 else if (options
->lp_solver
== BV_LP_GLPK
)
133 return glpk_polyhedron_range(D
, obj
, denom
, min
, max
, options
);
134 else if (options
->lp_solver
== BV_LP_CDD
)
135 return cdd_polyhedron_range(D
, obj
, denom
, min
, max
, options
);
136 else if (options
->lp_solver
== BV_LP_CDDF
)
137 return cddf_polyhedron_range(D
, obj
, denom
, min
, max
, options
);
138 else if (options
->lp_solver
== BV_LP_PIP
)
139 return pip_polyhedron_range(D
, obj
, denom
, min
, max
, options
);