add isl_set_min_val
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 13 Apr 2013 11:11:43 +0000 (13:11 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 28 May 2013 16:27:13 +0000 (18:27 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/ilp.h
isl_ilp.c

index 562a72f..473ce3d 100644 (file)
@@ -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<isl_lp_error>,
 C<isl_lp_ok>, C<isl_lp_unbounded> or C<isl_lp_empty>, in case of
 an C<isl_lp_result>.  If the result is an C<isl_val> then
 the result is C<NULL> 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
index 332d52e..5791ee6 100644 (file)
@@ -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);
 
index b10c3c2..2072bf6 100644 (file)
--- 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".
  *