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
)
47 enum order_sign
polyhedron_affine_sign(Polyhedron
*D
, Matrix
*T
,
48 struct barvinok_options
*options
)
50 if (options
->lp_solver
== BV_LP_POLYLIB
)
51 return PL_polyhedron_affine_sign(D
, T
, options
);
52 else if (options
->lp_solver
== BV_LP_GLPK
)
53 return glpk_polyhedron_affine_sign(D
, T
, options
);
54 else if (options
->lp_solver
== BV_LP_CDD
)
55 return cdd_polyhedron_affine_sign(D
, T
, options
);
56 else if (options
->lp_solver
== BV_LP_CDDF
)
57 return cddf_polyhedron_affine_sign(D
, T
, options
);
58 else if (options
->lp_solver
== BV_LP_ISL
)
59 return isl_polyhedron_affine_sign(D
, T
, options
);
65 * Optimize (minimize or maximize depending on dir) the affine
66 * objective function obj (of length dimension+1), with denominator
67 * denom over the polyhedron specified by the constraints C.
68 * The result is returned in opt.
70 enum lp_result
constraints_opt(Matrix
*C
, Value
*obj
, Value denom
,
71 enum lp_dir dir
, Value
*opt
,
72 struct barvinok_options
*options
)
74 if (options
->lp_solver
== BV_LP_POLYLIB
)
75 return PL_constraints_opt(C
, obj
, denom
, dir
, opt
, options
->MaxRays
);
76 else if (options
->lp_solver
== BV_LP_GLPK
)
77 return glpk_constraints_opt(C
, obj
, denom
, dir
, opt
);
78 else if (options
->lp_solver
== BV_LP_CDD
)
79 return cdd_constraints_opt(C
, obj
, denom
, dir
, opt
);
80 else if (options
->lp_solver
== BV_LP_CDDF
)
81 return cddf_constraints_opt(C
, obj
, denom
, dir
, opt
);
82 else if (options
->lp_solver
== BV_LP_ISL
)
83 return isl_constraints_opt(C
, obj
, denom
, dir
, opt
);
89 * Optimize (minimize or maximize depending on dir) the affine
90 * objective function obj (of length dimension+1), with denominator
91 * denom over the polyhedron specified by P.
92 * The result is returned in opt.
94 enum lp_result
polyhedron_opt(Polyhedron
*P
, Value
*obj
, Value denom
,
95 enum lp_dir dir
, Value
*opt
,
96 struct barvinok_options
*options
)
98 if (options
->lp_solver
== BV_LP_POLYLIB
)
99 return PL_polyhedron_opt(P
, obj
, denom
, dir
, opt
);
102 Polyhedron_Matrix_View(P
, &M
, P
->NbConstraints
);
103 return constraints_opt(&M
, obj
, denom
, dir
, opt
, options
);