[Ipopt] Wrapping two functions together in Ipopt API

Hisham Abdulla hishamopfem at gmail.com
Fri Dec 29 17:28:26 EST 2017


I'm a beginner in Ipopt as well as C++.

in Ipopt, I've to write implementations of the following functions, in a
class.

virtual bool eval_f(Index n, const Number* x, bool new_x, Number&
obj_value);virtual bool eval_grad_f(Index n, const Number* x, bool
new_x, Number* grad_f);

In my problem, eval_grad_f share many calculations and results with eval_f.
( For example, without obj_value I cannot calculate grad_f). If the both
functions were in a single wrapped function, that would have been much easy
for me. I want to reuse results and computation of eval_f in the
eval_grad_fun. Please suggest an efficient way to do this.


Hisham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20171230/0894257c/attachment.html>


More information about the Ipopt mailing list