isl_tab_solve_lp: invert optimal value back when computing maximum
authorSven Verdoolaege <sven@cs.kuleuven.be>
Wed, 16 Dec 2009 12:53:03 +0000 (12:53 +0000)
committerSven Verdoolaege <sven@cs.kuleuven.be>
Wed, 16 Dec 2009 12:53:03 +0000 (12:53 +0000)
A maximum is computed by computing the minimum of the opposite objective
function.  The maximal value is then the opposite of the computed value.

isl_lp.c

index 533f20f..c6feca4 100644 (file)
--- a/isl_lp.c
+++ b/isl_lp.c
@@ -29,6 +29,8 @@ enum isl_lp_result isl_tab_solve_lp(struct isl_basic_map *bmap, int maximize,
 
        if (maximize)
                isl_seq_neg(f, f, 1 + dim);
+       if (maximize && opt)
+               isl_int_neg(*opt, *opt);
 
        return res;
 }