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
)
21 #ifndef HAVE_LIBCDDGMP
22 enum order_sign
cdd_polyhedron_affine_sign(Polyhedron
*D
, Matrix
*T
,
23 struct barvinok_options
*options
)
28 enum order_sign
cddf_polyhedron_affine_sign(Polyhedron
*D
, Matrix
*T
,
29 struct barvinok_options
*options
)
34 enum lp_result
cdd_constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
35 enum lp_dir dir
, Value
*opt
)
40 enum lp_result
cddf_constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
41 enum lp_dir dir
, Value
*opt
)
48 enum lp_result
pip_constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
49 enum lp_dir dir
, Value
*opt
)
55 enum order_sign
polyhedron_affine_sign(Polyhedron
*D
, Matrix
*T
,
56 struct barvinok_options
*options
)
58 if (options
->lp_solver
== BV_LP_POLYLIB
)
59 return PL_polyhedron_affine_sign(D
, T
, options
);
60 else if (options
->lp_solver
== BV_LP_GLPK
)
61 return glpk_polyhedron_affine_sign(D
, T
, options
);
62 else if (options
->lp_solver
== BV_LP_CDD
)
63 return cdd_polyhedron_affine_sign(D
, T
, options
);
64 else if (options
->lp_solver
== BV_LP_CDDF
)
65 return cddf_polyhedron_affine_sign(D
, T
, options
);
71 * Optimize (minimize or maximize depending on dir) the affine
72 * objective function obj (of length dimension+1), with denominator
73 * denom over the polyhedron specified by the constraints C.
74 * The result is returned in opt.
76 enum lp_result
constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
77 enum lp_dir dir
, Value
*opt
,
78 struct barvinok_options
*options
)
80 if (options
->lp_solver
== BV_LP_POLYLIB
)
81 return PL_constraints_opt(C
, obj
, denom
, dir
, opt
, options
->MaxRays
);
82 else if (options
->lp_solver
== BV_LP_GLPK
)
83 return glpk_constraints_opt(C
, obj
, denom
, dir
, opt
);
84 else if (options
->lp_solver
== BV_LP_CDD
)
85 return cdd_constraints_opt(C
, obj
, denom
, dir
, opt
);
86 else if (options
->lp_solver
== BV_LP_CDDF
)
87 return cddf_constraints_opt(C
, obj
, denom
, dir
, opt
);
88 else if (options
->lp_solver
== BV_LP_PIP
)
89 return pip_constraints_opt(C
, obj
, denom
, dir
, opt
);
95 * Optimize (minimize or maximize depending on dir) the affine
96 * objective function obj (of length dimension+1), with denominator
97 * denom over the polyhedron specified by P.
98 * The result is returned in opt.
100 enum lp_result
polyhedron_opt(Polyhedron
*P
, Value
*obj
, Value denom
,
101 enum lp_dir dir
, Value
*opt
,
102 struct barvinok_options
*options
)
104 if (options
->lp_solver
== BV_LP_POLYLIB
)
105 return PL_polyhedron_opt(P
, obj
, denom
, dir
, opt
);
108 Polyhedron_Matrix_View(P
, &M
, P
->NbConstraints
);
109 return constraints_opt(&M
, obj
, denom
, dir
, opt
, options
);