I am rather new to Julia and I am experimenting with NLopt. I ran the tests on github and they work fine but then I tried my own objective and constraints.
I then followed the same procedure followed in the test examples but with a derivative free optimiser.
opt = Opt(:LN_COBYLA, 3)
opt.lower_bounds = [0, -Inf.-Inf]
opt.upper_bounds = [1,Inf,Inf]
opt.xtol_rel = 1e-4
opt.min_objective = ps
opt.inequality_constraint = (x,g) -> ps_con(x,g,[1,1])
(minf,minx,ret) = optimize(opt, [1,1,1])
No error occurs but the optimiser does not do anything and exits with either FORCED_STOP or XTOL_REACHED at the first iteration.
Note that calling the objective and constraint functions individually with random inputs does not produce any error.
What am I doing wrong?