On Jan 11, 2011, at 4:00 PM, math07 wrote:
I have one simple question, in the example in the tutorial, suppose I have the objective function including additional parameter 'p' i.e myfunc(x,grad,p), what is the form of 'opt.set_min_objective(myfunc)' in this case because I did try
but I found errors. many thanks

Do it exactly like the inequality constraints in the tutorial:

opt.set_min_objective(lambda x,grad: myfunc(x, grad, p))

i.e. use lambda to make an anonymous function of (x,grad) that passes through your p parameters.


_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to