chiark / gitweb /
added CCSAQ algorithm; internal support for preconditioners (untested) not yet export...
[nlopt.git] / api / optimize.c
index 49eea98b28d3049ba2cd1ce56e86ad0bdc591612..236519fb8ea8a7ed225a23a8279f747e6c55adf4 100644 (file)
@@ -642,7 +642,7 @@ static nlopt_result nlopt_optimize_(nlopt_opt opt, double *x, double *minf)
              return ret;
         }
 
-        case NLOPT_LD_MMA: {
+        case NLOPT_LD_MMA: case NLOPT_LD_CCSAQ: {
              nlopt_opt dual_opt;
              nlopt_result ret;
 #define LO(param, def) (opt->local_opt ? opt->local_opt->param : (def))
@@ -656,8 +656,14 @@ static nlopt_result nlopt_optimize_(nlopt_opt opt, double *x, double *minf)
              nlopt_set_maxeval(dual_opt, LO(maxeval, 100000));
 #undef LO
 
-             ret = mma_minimize(n, f, f_data, opt->m, opt->fc,
-                                lb, ub, x, minf, &stop, dual_opt);
+             if (algorithm == NLOPT_LD_MMA)
+                  ret = mma_minimize(n, f, f_data, opt->m, opt->fc,
+                                     lb, ub, x, minf, &stop, dual_opt);
+             else
+                  ret = ccsa_quadratic_minimize(
+                       n, f, f_data, opt->m, opt->fc,
+                       NULL, NULL, NULL, NULL,
+                       lb, ub, x, minf, &stop, dual_opt);
              nlopt_destroy(dual_opt);
              return ret;
         }