<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div>Hi Brad,</div>
<div><br>
</div>
Thanks for your reply. I'm not (yet) familiar with CppAD, but since I'm currently trying to figure out which of all the autodiff-packages to use for my project, it is good to know, that what I'm trying to do is possible with CppAD. It is also nice to know,
 that a combination of ADOL-C and CppAD is easy.
<div><br>
</div>
<div>Thomas<br>
<div><br>
<div>--&nbsp;<br>
Thomas Leitz<br>
Chair of Applied Dynamics<br>
University of Erlangen-Nuremberg<br>
Haberstrasse 1<br>
D-91058 Erlangen, Germany<br>
room 01.012<br>
phone&nbsp;&#43;49 (0)9131 85 61005 </div>
<br>
<div>
<div>On 09.05.2015, at 23:49, Brad Bell &lt;<a href="mailto:bradbell@seanet.com">bradbell@seanet.com</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">The following example demonstrates having a Sparse Hessian w.r.t. one set of variables and parameters (in the sense below) with respect to another set of variables.
<br>
&nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.coin-or.org/CppAD/Doc/sub_sparse_hes.cpp.xml">
http://www.coin-or.org/CppAD/Doc/sub_sparse_hes.cpp.xml</a><br>
It makes use of the fact that CppAD allows for AD&lt; AD&lt;double&gt; &gt;.&nbsp; I think that this example could be modified to accomplish your goal below.
<br>
<br>
Note that one can use ADOLC at the lower level; i.e., use<br>
&nbsp;&nbsp;&nbsp; CppAD::AD&lt; adouble &gt;<br>
where adouble is the ADOLC type adouble; see<br>
&nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.coin-or.org/CppAD/Doc/mul_level_adolc.cpp.xml">
http://www.coin-or.org/CppAD/Doc/mul_level_adolc.cpp.xml</a><br>
<br>
On 5/8/2015 3:49 PM, Leitz, Thomas wrote:<br>
</div>
<blockquote cite="mid:%3CFC2CBD6FADFAB545A8A1BD731635DA21737B69D1@mbx1.exch.fau.de%3E" type="cite">
<meta http-equiv="Context-Type" content="text/html;
        charset=iso-8859-1">
<div>
<div>
<div>Hi,</div>
<div><br>
</div>
<div>lets assume I have a function f(x,y) : R^n \times R^m -&gt; R and I only need the gradient with respect to x, but every time I need to change both variables x and y. (y could be some parameters like coefficients of a polynomial function etc.). There are basically
 two ways I know how to achieve this:</div>
<div><br>
</div>
<div>1. mark both x and y as independent variables, tape once and every time I need a gradient I compute the whole gradient df/d(x,y) at some (x0,y0) and just use df/dx (i.e. the first n values of the gradient df/d(x,y)). This way I can change both variables
 but I also compute the gradient df/dy that I don't need.</div>
<div><br>
</div>
<div>2. mark only x as independent and tape the function with any y0 every time before computing the gradient df/dx.</div>
<div><br>
</div>
<div>Is there any way to tape once, and later compute the gradient df/dx at any (x0,y0) without retaping?</div>
<div><br>
</div>
<div><br>
</div>
<div>Thomas</div>
</div>
</div>
</blockquote>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>