isl_solve_lp: accept affine object function instead of linear function
[platform/upstream/isl.git] / isl_lp.c
1 #include "isl_ctx.h"
2 #include "isl_lp.h"
3 #include "isl_lp_piplib.h"
4
5 /* Given a basic map "bmap" and an affine combination of the variables "f"
6  * with denominator "denom", set *opt/*opt_denom to the minimal
7  * (or maximal if "maximize" is true) value attained by f/d over "bmap",
8  * assuming the basic map is not empty and the expression cannot attain
9  * arbitrarily small (or large) values.
10  * If opt_denom is NULL, then *opt is rounded up (or down)
11  * to the nearest integer.
12  * The return value reflects the nature of the result (empty, unbounded,
13  * minmimal or maximal value returned in *opt).
14  */
15 enum isl_lp_result isl_solve_lp(struct isl_basic_map *bmap, int maximize,
16                                       isl_int *f, isl_int denom, isl_int *opt,
17                                       isl_int *opt_denom)
18 {
19         return isl_pip_solve_lp(bmap, maximize, f, denom, opt, opt_denom);
20 }