Posted by
Ferdinando M. Ametrano-3 on
URL: http://quantlib.414.s1.nabble.com/Performance-question-tp8763p8769.html
Hi all
On Tue, Aug 2, 2011 at 10:59 PM, Slava Mazur <
[hidden email]> wrote:
> Perhaps this is because the interpolation implementation classes perform
> binary search to locate the position of every x argument. If you call it
> thousands of times there will be thousands binary searches.
for me it's hard to believe that bisection might be an efficiency
bottleneck in a real-world financial usage of linear interpolation...
It could be improved (e.g. caching the bracketing result as guess for
the next one)
> Also, I’d like to take this opportunity to point out that there is a
> potential danger in the design of interpolation objects – they take
> iterators as input during construction. This is an additional argument in
> favor of use of interpolation object as a temporal one.
you're right: interpolations are meant to be contained inside some
other object which guarantees persistence of the X and Y vectors to be
interpolated. An example of such a container is
QuantLibAddin::Interpolation, which also implement the (lazy)
observability of the QuantLib::Quote vector used as Y vector.
I personally advocate moving QuantLibAddin::Interpolation in QuantLib,
but if I'm not wrong Luigi is skeptical
ciao -- Nando
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users