From: Sven Verdoolaege Date: Sat, 13 Apr 2013 11:11:43 +0000 (+0200) Subject: add isl_set_min_val X-Git-Tag: isl-0.12~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2442d7044574e7d4b16770e70e9a62a546f7df5c;p=platform%2Fupstream%2Fisl.git add isl_set_min_val Signed-off-by: Sven Verdoolaege --- diff --git a/doc/user.pod b/doc/user.pod index 562a72f..473ce3d 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -2581,6 +2581,9 @@ a singleton subset of the input. Otherwise, return an empty set. __isl_keep isl_aff *obj); enum isl_lp_result isl_set_min(__isl_keep isl_set *set, __isl_keep isl_aff *obj, isl_int *opt); + __isl_give isl_val *isl_set_min_val( + __isl_keep isl_set *set, + __isl_keep isl_aff *obj); enum isl_lp_result isl_set_max(__isl_keep isl_set *set, __isl_keep isl_aff *obj, isl_int *opt); __isl_give isl_val *isl_set_max_val( @@ -2593,7 +2596,7 @@ The return value may be one of C, C, C or C, in case of an C. If the result is an C then the result is C in case of an error, the optimal value in case -there is one, infinity if the problem is unbounded and +there is one, negative infinity or infinity if the problem is unbounded and NaN if the problem is empty. =item * Parametric optimization diff --git a/include/isl/ilp.h b/include/isl/ilp.h index 332d52e..5791ee6 100644 --- a/include/isl/ilp.h +++ b/include/isl/ilp.h @@ -29,6 +29,8 @@ enum isl_lp_result isl_set_min(__isl_keep isl_set *set, __isl_keep isl_aff *obj, isl_int *opt); enum isl_lp_result isl_set_max(__isl_keep isl_set *set, __isl_keep isl_aff *obj, isl_int *opt); +__isl_give isl_val *isl_set_min_val(__isl_keep isl_set *set, + __isl_keep isl_aff *obj); __isl_give isl_val *isl_set_max_val(__isl_keep isl_set *set, __isl_keep isl_aff *obj); diff --git a/isl_ilp.c b/isl_ilp.c index b10c3c2..2072bf6 100644 --- a/isl_ilp.c +++ b/isl_ilp.c @@ -610,6 +610,18 @@ __isl_give isl_val *isl_set_opt_val(__isl_keep isl_set *set, int max, return convert_lp_result(lp_res, res, max); } +/* Return the minimum of the integer affine + * expression "obj" over the points in "set". + * + * Return infinity or negative infinity if the optimal value is unbounded and + * NaN if "bset" is empty. + */ +__isl_give isl_val *isl_set_min_val(__isl_keep isl_set *set, + __isl_keep isl_aff *obj) +{ + return isl_set_opt_val(set, 0, obj); +} + /* Return the maximum of the integer affine * expression "obj" over the points in "set". *