[Ipopt] Wrapping two functions together in Ipopt API
Wendel Melo
wendelalexandre at gmail.com
Fri Dec 29 21:30:45 EST 2017
A first idea is try use the input parameter "bool new_x" in those methods.
Anyway, you have to be careful about that...
I suggest you should first build your application without care about this
kind of efficiency (that is already difficult by itself). After you are
sure your code is right, you can think about how to improve its
performance.
2017-12-29 20:28 GMT-02:00 Hisham Abdulla <hishamopfem at gmail.com>:
> 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
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/ipopt
>
>
--
Wendel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20171230/40443c9b/attachment-0001.html>
More information about the Ipopt
mailing list