PiecewiseYieldCurve

Posted by Plamen Neykov on
URL: http://quantlib.414.s1.nabble.com/PiecewiseYieldCurve-tp3949.html

Hi all,

I'm using the PiecewiseFlatForward and accounted some strange behaviour there
- I think it is just because the  PiecewiseYieldCurve class had not
overwritten the DiscountFactor discountImpl(Time) const method and therefore
the calculate() method of the LazyObject (resp. the
PiecewiseYieldCurve<C,I>::performCalculations() method) got never called.

I've added the following implementation in the PiecewiseYieldCurve and it
solved my problem:

template <class C, class I>
inline DiscountFactor PiecewiseYieldCurve<C,I>::discountImpl(Time t) const {
        calculate();
        return base_curve::discountImpl(t);
}


Am I seeing this correct or is there something other going wrong?

cheers
Plamen

attachment0 (189 bytes) Download Attachment