Since I also had some troubles using MLSL_LDS I add some example code that 
worked for me:

using NLopt

count = 0 # keep track of # function evaluations

function myfunc(x::Vector, grad::Vector)
    global count
    count::Int += 1

    sqrt(x[2])
end

opt = Opt(:GN_MLSL_LDS, 2)
subopt = Opt(:LN_NELDERMEAD, 2)
for o in [opt, subopt]
  upper_bounds!(o, [100.0, 100.0])
  lower_bounds!(o, [0.0, 0.0])
  xtol_rel!(o, 1e-4)
  min_objective!(o, myfunc)
  maxtime!(o, 5.0)
end
local_optimizer!(opt, subopt)
(minf,minx,ret) = optimize(opt, [1.234, 5.678])

Cheers,

Robert Feldt

Reply via email to