[CppAD] Discrete AD functions and linear interpolation

herve.martin.sc@libertysurf.fr herve.martin.sc at libertysurf.fr
Thu Sep 13 05:40:18 EDT 2007


Hi,

I would like to rewrite a big simulation code to use CppAD. However, I run into a problem with the discrete functions. My code uses a lot of lookup tables with linear/spline interpolation. So it seems to me that the natural choice in CppAD is to perform the linear interpolation with discrete functions declared with the CPPAD_DISCRETE_FUNCTION macro. 

The problem is that the interface of this function does not allow to pass additional data to compute the needed values, just a double argument. So for each set of data, a new set of functions has to be defined. 
More, in the example Piecewise.cpp, the lookup tables are global variables. But my tables are read at runtime in many files. How can I specify to CppAD which table to use in my code, so that the correct table is chosen during a sweep of the tape ? I absolutely want to avoid static / global variables to avoid reentrancy problems...

I hope I was clear enough...
Thanks in advance for any help.

Hervé Martin


------------------------ ALICE C'EST ENCORE MIEUX AVEC CANAL+ LE BOUQUET ! ---------------
Découvrez vite l'offre exclusive ALICEBOX et CANAL+ LE BOUQUET, en cliquant ici http://alicebox.fr
Soumis à conditions.





More information about the CppAD mailing list