<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi,<br><br>I'm doing non-linear optimization with IPOPT. For this, I'm using ADOL-C<br>to compute the Hessian of the Lagrangian<br><br>L(x,lambda) = f(x) + sum_{i}lambda_{i}h_{i}(x),<br><br>where x are the variables, lambda the Lagrange multipliers and <br>f(x) and h_{i}(x) objective and constraint functions.<br><br>What I'm doing in my code is the following (omitting details):<br><br>// **********************<br><br>// Trace Lagrangian function<br>trace_on(tag);<br><br>for(i=0;i<n;i++) {<br> xad[i] <<= x[i];<br>}<br><br>Lagrangian(xad, lambda);<br><br>Lad >>=L;<br><br>trace_off();<br><br>// Evaluate Hessian of the Lagrangian<br>repeat = 0;<br>sparse_hess(tag,n,repeat,x,&nnz,&rind,&cind,&values,&options)<br><br>// ***********************<br><br>This works fine, but is not so efficient. One reason is that, since lambda changes, <br>the Lagrangian function has to be retaped every time the Hessian is needed and so it <br>appears that I cannot set repeat = 1 when calling sparse_hess.<br><br>One way to circumvent this problem could perhaps be to trace the objective<br>and constraint functions individually and then construct the Hessian of<br>the Lagrangian using multiple calls to sparse_hess, but is there a<br>more convenient way to do it? <br><br>Sincerely,<br><br>Ingrid<br><br>                                            </div></body>
</html>