You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am struggling with NLopt.jl. The following, simple objective is called with initial value [1,1,1,1], this value never changes, and the algorithm will not find the solution [0,0,0,0].
Any help is highly appreciated and thanks in advance.
using NLopt
function fun(Y::Vector, grad::Vector)::Float64
if length(grad) > 0
grad= 2*Y
end
@show "objective", length(grad), Y
return Y'*Y
end
opt= Opt(:LD_MMA, 4)
opt.maxeval= 10
opt.max_objective= fun
(minf,minx,ret)= optimize(opt, ones(4))
numevals= opt.numevals
println("got $minf at $minx after $numevals iterations (returned $ret)")
The text was updated successfully, but these errors were encountered:
I am struggling with NLopt.jl. The following, simple objective is called with initial value
[1,1,1,1]
, this value never changes, and the algorithm will not find the solution[0,0,0,0]
.Any help is highly appreciated and thanks in advance.
The text was updated successfully, but these errors were encountered: