|
From: Luigi B. <lui...@gm...> - 2008-07-16 15:01:46
|
On Tue, 2008-07-15 at 12:21 -0400, Luca Billi wrote: > the following code throws an exception when > bond.cleanPriceFromZSpread(...) is called. > The issue comes from the fact that, in this example, there's no > settlement adjustment, so the function > ZeroSpreadedTermStructure::zeroYieldImpl(Time t) needs to be evaluated > for t=0. > > I got around this issue by adding the seemingly harmless > > if(t==0.) return 1.; > > at line 86 of file ql/termstructures/yield/zeroyieldstructure.hpp > > Anyone has a better idea? I'd rather fix ZeroSpreadedTermStructure::zeroYieldImpl so that it works at t=0. Did you happen to investigate what goes wrong inside there? Later, Luigi -- Just remember what ol' Jack Burton does when the earth quakes, the poison arrows fall from the sky, and the pillars of Heaven shake. Yeah, Jack Burton just looks that big old storm right in the eye and says, "Give me your best shot. I can take it." -- Jack Burton, "Big trouble in Little China" |