chiark / gitweb /
add set_max_objective to automate the sign flip for maximization
[nlopt.git] / mma / mma.c
index 3451b4971fe44ade1f3fa75d973ed3cc14f37619..feba141fda61a74aef79d3e0b115bacc2b1e5b8e 100644 (file)
--- a/mma/mma.c
+++ b/mma/mma.c
@@ -231,6 +231,7 @@ nlopt_result mma_minimize(int n, nlopt_func f, void *f_data,
      nlopt_set_min_objective(dual_opt, dual_func, &dd);
      nlopt_set_lower_bounds(dual_opt, dual_lb);
      nlopt_set_upper_bounds(dual_opt, dual_ub);
+     nlopt_set_stopval(dual_opt, -HUGE_VAL);
 
      while (1) { /* outer iterations */
          double fprev = fcur;