Posted by
Luigi Ballabio on
Feb 18, 2015; 2:24pm
URL: http://quantlib.414.s1.nabble.com/Adjoint-Greeks-tp16147p16272.html
Hi Peter and Alexander,
apologies for chiming in so late. I've been thinking a bit about this, and as usual I didn't make up my mind, as I seem to agree with both of you :)
I agree with Alexander that the typedef approach is surely less scary than templatizing most of the library (especially from my other perspective of having to teach and write about the library from time to time...) but I also see Peter's point of not having to pay for adjoints when one doesn't use them.
So, here's a crazy idea. Feel free to punch holes in it as you see fit. In the template approach, AD and Real versions of objects are not really compatible as I understand it; that is, you can't set an engine using AD<Real> to an instrument using Real (is this correct, Peter?) so in a way, it's as if they're part of two different libraries. What if one actually made two different libraries, one compiled with Real and the other with AD<Real>? Using a macro to change the namespace in the second one to something like QuantLibAD should be enough to prevent resolution conflicts when using both. What do you think?
About the CppAD patch: yes, having to rely on a patch is kind of awkward. Alexander, did you try looking into Peter's solution for this? (If I remember correctly, it was a specialization of our Null class for AD<double> which you could integrate in your code.)
Needless to say, I would be a very happy maintainer if I got the two of you on the same project instead of two competing ones...
Later,
Luigi
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev