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
);
66 else if (options
->lp_solver
== BV_LP_ISL
)
67 return isl_polyhedron_affine_sign(D
, T
, options
);
73 * Optimize (minimize or maximize depending on dir) the affine
74 * objective function obj (of length dimension+1), with denominator
75 * denom over the polyhedron specified by the constraints C.
76 * The result is returned in opt.
78 enum lp_result
constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
79 enum lp_dir dir
, Value
*opt
,
80 struct barvinok_options
*options
)
82 if (options
->lp_solver
== BV_LP_POLYLIB
)
83 return PL_constraints_opt(C
, obj
, denom
, dir
, opt
, options
->MaxRays
);
84 else if (options
->lp_solver
== BV_LP_GLPK
)
85 return glpk_constraints_opt(C
, obj
, denom
, dir
, opt
);
86 else if (options
->lp_solver
== BV_LP_CDD
)
87 return cdd_constraints_opt(C
, obj
, denom
, dir
, opt
);
88 else if (options
->lp_solver
== BV_LP_CDDF
)
89 return cddf_constraints_opt(C
, obj
, denom
, dir
, opt
);
90 else if (options
->lp_solver
== BV_LP_PIP
)
91 return pip_constraints_opt(C
, obj
, denom
, dir
, opt
);
92 else if (options
->lp_solver
== BV_LP_ISL
)
93 return isl_constraints_opt(C
, obj
, denom
, dir
, opt
);
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 P.
102 * The result is returned in opt.
104 enum lp_result
polyhedron_opt(Polyhedron
*P
, 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_polyhedron_opt(P
, obj
, denom
, dir
, opt
);
112 Polyhedron_Matrix_View(P
, &M
, P
->NbConstraints
);
113 return constraints_opt(&M
, obj
, denom
, dir
, opt
, options
);