[Ipopt] Extract Objective Function Gradient in finalize_solution(...)

Hans Pirnay hans.pirnay at rwth-aachen.de
Thu Jan 17 13:21:50 EST 2013


this should work:

SmartPtr<DenseVector> curr_grad = dynamic_cast<const
DenseVector*>(GetRawPtr(ip_cq->curr_grad_f()));
const double* grad_values = curr_grad->Values();

You'll probably have to #include "IpDenseVector.hpp" and maybe some
other dependencies.

Hans

On Thu, Jan 17, 2013 at 6:30 PM, Knut Heidemann <heidemannknut at gmail.com> wrote:
> Hi,
>
> I am trying to access the objective function gradient information after my
> problem has been solved.
> I assume that this is done in finalize_solution(...).
> Unfortunately, I do not manage to use "ip_cq" for this purpose. Can anybody
> tell me how the appropriate line of code would look like?
>
> Best regards,
> Knut Heidemann.
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt


More information about the Ipopt mailing list