<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
If you look at the heading Partial Implementation<br>
<a class="moz-txt-link-freetext" href="http://www.coin-or.org/CppAD/Doc/user_atomic.xml">http://www.coin-or.org/CppAD/Doc/user_atomic.xml</a><br>
you will find the following specification: "The forward the routine,
for the case k = 0, must be implemented. Functions with the correct
prototype, that just return false, can be used for the other cases
(unless they are required by your calculations)."<br>
<br>
Forward mode with k=0 evaluates function values, with k=1, it
evaluates derivatives. So it sound to me like you just need to
return false for all other values of k and all the other functions.
An then use first order forward mode to evaluation your derivatives<br>
<a class="moz-txt-link-freetext" href="http://www.coin-or.org/CppAD/Doc/forwardone.xml">http://www.coin-or.org/CppAD/Doc/forwardone.xml</a><br>
<br>
If you look at the forward function in the example<br>
<a class="moz-txt-link-freetext" href="http://www.coin-or.org/CppAD/Doc/user_tan.cpp.xml">http://www.coin-or.org/CppAD/Doc/user_tan.cpp.xml</a><br>
it may help to also look at <br>
<a class="moz-txt-link-freetext" href="http://www.coin-or.org/CppAD/Doc/tan_forward.xml">http://www.coin-or.org/CppAD/Doc/tan_forward.xml</a><br>
in order to understand how the derivative of the tangent is
calculated for this example. It sounds like you will only need first
order derivatives and can ignore the code for the higher order cases
(just return false in those cases).<br>
<br>
On 01/02/2012 08:41 AM, Michael Braun wrote:
<blockquote cite="mid:6F235582-E33F-4EA1-B25E-8ADCF96C71B2@mit.edu"
type="cite">
<pre wrap="">Hi. I am started to look into using CppAD for some research projects, and I have a question about defining special functions. As an example, I often use the log gamma (lgamma) function, and I know that its first derivative is a digamma function. How can I tell CppAD this? I see that there is a CPPAD_USER_ATOMIC macro, but this macro seems to want me to encode the specifics of the forward and reverse modes. Since I am a mere end-user of AD, and not very familiar with the algorithmic details, I am hoping that there is an easier way to do this.
Thanks,
Michael Braun
braunm _at_ mit.edu
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
CppAD mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CppAD@list.coin-or.org">CppAD@list.coin-or.org</a>
<a class="moz-txt-link-freetext" href="http://list.coin-or.org/mailman/listinfo/cppad">http://list.coin-or.org/mailman/listinfo/cppad</a>
</pre>
</blockquote>
<br>
</body>
</html>