Opt.setMinObjective

Set Minimum Objective

Equivalent in C API: nlopt_set_min_objective

Params:

f = function pointer representing objective, must be extern(C)

f_data = additional data to pass to function (optional)
struct Opt
void
setMinObjective
(
T
U...
)
(
T f
,
ref U f_data
)

Examples

my_constraint_data[2] c_data = [{2.0, 0.0}, {-1.0, 1.0}];

auto opt = Opt(Algorithm.ldMMA, 2);
opt.setMinObjective(&myFuncC, c_data);

assert(opt.getResult() > 0);
auto opt = Opt(Algorithm.ldMMA, 2);
opt.setMinObjective(&myFuncC);

assert(opt.getResult() > 0);

Meta