[ADOL-C] Evaluating Hessian of Lagrangian
Ingrid Hallen
ingridhallen at hotmail.com
Fri Apr 5 07:02:57 EDT 2013
Hi,
I'm doing non-linear optimization with IPOPT. For this, I'm using ADOL-C
to compute the Hessian of the Lagrangian
L(x,lambda) = f(x) + sum_{i}lambda_{i}h_{i}(x),
where x are the variables, lambda the Lagrange multipliers and
f(x) and h_{i}(x) objective and constraint functions.
What I'm doing in my code is the following (omitting details):
// **********************
// Trace Lagrangian function
trace_on(tag);
for(i=0;i<n;i++) {
xad[i] <<= x[i];
}
Lagrangian(xad, lambda);
Lad >>=L;
trace_off();
// Evaluate Hessian of the Lagrangian
repeat = 0;
sparse_hess(tag,n,repeat,x,&nnz,&rind,&cind,&values,&options)
// ***********************
This works fine, but is not so efficient. One reason is that, since lambda changes,
the Lagrangian function has to be retaped every time the Hessian is needed and so it
appears that I cannot set repeat = 1 when calling sparse_hess.
One way to circumvent this problem could perhaps be to trace the objective
and constraint functions individually and then construct the Hessian of
the Lagrangian using multiple calls to sparse_hess, but is there a
more convenient way to do it?
Sincerely,
Ingrid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/adol-c/attachments/20130405/54191f7a/attachment.html>
More information about the ADOL-C
mailing list