end
opt.algorithm = algorithm;
opt.min_objective = @(x) f(x, f_data{:});
-opt.lb = lb;
-opt.ub = ub;
+opt.lower_bounds = lb;
+opt.upper_bounds = ub;
for i = 1:length(fc)
opt.fc{i} = @(x) fc{i}(x, fc_data{i}{:});
end
opt = nlopt_create(algorithm, n);
CHECK1(opt, "nlopt: out of memory");
- nlopt_set_lower_bounds(opt, struct_arrval(opts, "lb", n,
+ nlopt_set_lower_bounds(opt, struct_arrval(opts, "lower_bounds", n,
fill(tmp, n, -HUGE_VAL)));
- nlopt_set_upper_bounds(opt, struct_arrval(opts, "ub", n,
+ nlopt_set_upper_bounds(opt, struct_arrval(opts, "upper_bounds", n,
fill(tmp, n, +HUGE_VAL)));
nlopt_set_stopval(opt, struct_val_default(opts, "stopval", -HUGE_VAL));
CHECK1(opt, "nlopt: out of memory");
Matrix m_inf(1, n, -HUGE_VAL);
- Matrix lb = struct_val_default(opts, "lb", m_inf);
- CHECK1(n == lb.length(), "wrong length of opt.lb");
+ Matrix lb = struct_val_default(opts, "lower_bounds", m_inf);
+ CHECK1(n == lb.length(), "wrong length of opt.lower_bounds");
CHECK1(nlopt_set_lower_bounds(opt, lb.data()) > 0, "nlopt: out of memory");
Matrix p_inf(1, n, +HUGE_VAL);
- Matrix ub = struct_val_default(opts, "ub", p_inf);
- CHECK1(n == ub.length(), "wrong length of opt.ub");
+ Matrix ub = struct_val_default(opts, "upper_bounds", p_inf);
+ CHECK1(n == ub.length(), "wrong length of opt.upper_bounds");
CHECK1(nlopt_set_upper_bounds(opt, ub.data()) > 0, "nlopt: out of memory");
nlopt_set_stopval(opt, struct_val_default(opts, "stopval", -HUGE_VAL));
% BOUND CONSTRAINTS:
%
% Lower and/or upper bounds for the design variables x are specified
-% via opt.lb and/or opt.ub, respectively: these are vectors (of the
-% same length as xinit, above) giving the bounds in each component.
-% An unbounded component may be specified by a lower/upper bound of
-% -inf/+inf, respectively. If opt.lb and/or opt.ub are not specified,
-% the default bounds are -inf/+inf (i.e. unbounded), respectively.
+% via opt.lower_bounds and/or opt.upper_bounds, respectively: these
+% are vectors (of the same length as xinit, above) giving the bounds
+% in each component. An unbounded component may be specified by a
+% lower/upper bound of -inf/+inf, respectively. If opt.lower_bounds
+% and/or opt.upper_bounds are not specified, the default bounds are
+% -inf/+inf (i.e. unbounded), respectively.
%
% NONLINEAR CONSTRAINTS:
%