"Bound-constrained optimization via NEWUOA-based quadratic models (local, no-derivative)",
"Nelder-Mead simplex algorithm (local, no-derivative)",
"Sbplx variant of Nelder-Mead (re-implementation of Rowan's Subplex) (local, no-derivative)",
+ "Augmented Lagrangian method (needs sub-algorithm)",
+ "Augmented Lagrangian method for equality constraints (needs sub-algorithm)",
"Augmented Lagrangian method (local, no-derivative)",
"Augmented Lagrangian method (local, derivative)",
"Augmented Lagrangian method for equality constraints (local, no-derivative)",
return ret;
}
+ case NLOPT_AUGLAG:
+ case NLOPT_AUGLAG_EQ:
case NLOPT_LN_AUGLAG:
case NLOPT_LN_AUGLAG_EQ:
case NLOPT_LD_AUGLAG:
case NLOPT_LD_AUGLAG_EQ: {
nlopt_opt local_opt = opt->local_opt;
nlopt_result ret;
+ if ((algorithm == NLOPT_AUGLAG || algorithm == NLOPT_AUGLAG_EQ)
+ && !local_opt)
+ return NLOPT_INVALID_ARGS;
if (!local_opt) { /* default */
local_opt = nlopt_create(
algorithm == NLOPT_LN_AUGLAG ||
opt->p, opt->h,
lb, ub, x, minf, &stop,
local_opt,
- algorithm == NLOPT_LN_AUGLAG_EQ
+ algorithm == NLOPT_AUGLAG_EQ
+ || algorithm == NLOPT_LN_AUGLAG_EQ
|| algorithm == NLOPT_LD_AUGLAG_EQ);
opt->force_stop_child = NULL;
if (!opt->local_opt) nlopt_destroy(local_opt);
/*************************************************************************/
-#define AUGLAG_ALG(a) ((a) == NLOPT_LN_AUGLAG || \
+#define AUGLAG_ALG(a) ((a) == NLOPT_AUGLAG || \
+ (a) == NLOPT_AUGLAG_EQ || \
+ (a) == NLOPT_LN_AUGLAG || \
(a) == NLOPT_LN_AUGLAG_EQ || \
(a) == NLOPT_LD_AUGLAG || \
(a) == NLOPT_LD_AUGLAG_EQ)
double ICM = HUGE_VAL, minf_penalty = HUGE_VAL, penalty;
double *xcur = NULL, fcur;
int i, feasible, minf_feasible = 0;
+ int auglag_iters = 0;
/* magic parameters from Birgin & Martinez */
const double tau = 0.5, gam = 10;
if (ICM > tau * prev_ICM) {
d.rho *= gam;
}
+
+ auglag_iters++;
if (auglag_verbose) {
- printf("auglag: ICM=%g, rho=%g\nauglag lambda=", ICM, d.rho);
+ printf("auglag %d: ICM=%g (%sfeasible), rho=%g\nauglag lambda=",
+ auglag_iters, ICM, feasible ? "" : "not ", d.rho);
for (i = 0; i < d.p; ++i) printf(" %g", d.lambda[i]);
- printf("\nauglag mu = ");
+ printf("\nauglag %d: mu = ", auglag_iters);
for (i = 0; i < d.m; ++i) printf(" %g", d.mu[i]);
printf("\n");
}
if ((feasible && (!minf_feasible || penalty < minf_penalty
- || fcur <= *minf)) ||
- (!minf_feasible && penalty <= minf_penalty)) {
+ || fcur < *minf)) ||
+ (!minf_feasible && penalty < minf_penalty)) {
ret = NLOPT_SUCCESS;
if (feasible) {
if (fcur < stop->minf_max)
else if (nlopt_stop_x(stop, xcur, x))
ret = NLOPT_XTOL_REACHED;
}
- else { /* check if no progress towards feasibility */
- if (nlopt_stop_ftol(stop, fcur, *minf)
- && nlopt_stop_ftol(stop, penalty, minf_penalty))
- ret = NLOPT_FTOL_REACHED;
- else if (nlopt_stop_x(stop, xcur, x))
- ret = NLOPT_XTOL_REACHED;
- }
*minf = fcur;
minf_penalty = penalty;
minf_feasible = feasible;