Serialization of QuantLib classes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Serialization of QuantLib classes

Ben Khosrownia
Hi All:

I am a newbie and am in the need of serializing an
instance of PiecewiseFlatForward object (deep
serialization). Is that possible?

Any clues is appreciated.

Thank you;

Ben


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


Reply | Threaded
Open this post in threaded view
|

Re: Serialization of QuantLib classes

Luigi Ballabio
On 1/25/06, Ben Khosrownia <[hidden email]> wrote:
> Hi All:
>
> I am a newbie and am in the need of serializing an
> instance of PiecewiseFlatForward object (deep
> serialization). Is that possible?

Ben,
    apologies for the late reply. At this time, there's no code in the
library which deals with serialization. Your best bet would be to save
the dates and forwards at the curve nodes; you can retrieve the dates
by means of the dates() method and the forwards by asking the curve
for them at each date. Later you can rebuild the curve by creating the
vectors of dates and forwards and using them to instantiate an
InterpolatedForwardCurve; you'll need to use backward-flat
interpolation to reproduce the piecewise-flat forwards.

Later,
    Luigi