Login  Register

Re: Passing CubicSplines

Posted by Giancarlo Pfeifer-2 on Jul 12, 2006; 12:30pm
URL: http://quantlib.414.s1.nabble.com/Passing-CubicSplines-tp4913p4917.html

> I'm not extremely happy about it either. On the other hand, storing iterators
> allows the interpolation to maintain a link to the original values and to
> update itself when they change; copying the values would prevent this.
>
> Luigi

Thanks for the replies. It's only a stylistic issue, so now that i know
that this is the correct way to use the spline i'll adjust my coding.

My only thought in favour of copying the arrays is that
while it is true that by maintaining the link to the vectors allows the
curve to update itself, it is also true that you need to invoke the
"calculate()" method explicitly to recompute the coefficients and the
derivatives.

Therefore i'm thinking that a possible alternative is to copy the vectors
during the initialisation, and modify the method "calculate()" to pass in
the updated vectors. But it's probably not worth doing, and there probably
are other considerations i haven't though about...

Thanks a lot for your explanations, and thanks for your wonderful work!
gc

               
___________________________________________________________
Does your mail provider give you FREE antivirus protection?
Get Yahoo! Mail http://uk.mail.yahoo.com