[CppAD] copy of adfun object
Brad Bell
bradbell at seanet.com
Wed Oct 21 11:37:50 EDT 2009
ADFun objects can have a large amount of information connected to them.
For this reason, one should avoid making copies of the associated
information. Along these lines, there is a default ADFun constructor
that has a very minimal about of information in it. See the
documentation for the ADFun default constructor:
http://www.coin-or.org/CppAD/Doc/funconstruct.xml#Default%20Constructor
I would put an ADFun<Base> object in your new class and use the default
constructor for the object. Then, define a member function that moves
the current operation sequence into the ADFun<Base> object using the
Dependent function; see
http://www.coin-or.org/CppAD/Doc/dependent.xml
You can see an example of this intended use of CppAD at
http://www.coin-or.org/CppAD/Doc/ad_fun.cpp.xml
Dominik Skanda wrote:
> Thank you for your reply,
> I want to tape a algorithmic function.
> This taped function I want to use inside a new class.
> Therefore I copy the ADFun object to this new class in the hope that I
> have all informations inside the new class. Specially I use the
> ForwardZero and ForwardOne methods inside this class.
>
> Kind regards,
> Dominik Skanda
>
>
>
...
>
>
>
More information about the CppAD
mailing list