[ADOL-C] Wrapper around adouble

Andrea Walther awalther at math.uni-paderborn.de
Thu Sep 15 16:45:04 EDT 2011

Hi João,

> I am currently developing a modeling library that makes heavy use of adolc.

great to hear this.

> Wrapper c = b; // the wrappers holds a double (no tapping)
> Wrapper d = 5.0; // the wrappers holds a double (no tapping)
> c = 4*2 + d; // the wrappers still holds a double (no tapping)
> c += a; // now it holds an adouble (tapped)
> ###########
> Does this make any sense?

yes, that might work. The only disadvantage that I see is the implementation.

The data type of c has to have a double and an adouble component. For each
operation that involves c one has to test whether the double or the adouble
component is "active". This means that you have to overload all operations
correspondingly. If you are willing to do this then it should work and  
the taping effort should be minimized.

> Does adolc internally already do this?

No, ADOL-C just has a adouble class that contains essentially the  
corresponding double value and an identifyer.

Hope this helps!

Andrea Walther

More information about the ADOL-C mailing list