26#include <ql/patterns/lazyobject.hpp>
27#include <ql/termstructures/defaulttermstructure.hpp>
40 const std::vector<Handle<Quote> > recoveryRates,
const std::vector<Date>& switchDates,
41 const Handle<Quote> recoveryRate,
const DayCounter& dayCounter,
const bool extrapolate)
46 "source curve size (" <<
sourceCurves_.size() <<
") minus 1 and switch dates size ("
49 "source curve size (" <<
sourceCurves_.size() <<
") must match recovery rates size ("
55 <<
" at indices " << i - 1 <<
", " << i);
61 enableExtrapolation(extrapolate);
71 [](
const Real s,
const Real t) { return s < t && !QuantLib::close_enough(s, t); }) -
73 QL_REQUIRE(idx <
sourceCurves_.size(),
"internal error: source curve index is "
74 << idx <<
", number of source curves is " <<
sourceCurves_.size());
76 for (Size i = 0; i < idx; ++i) {
77 Real t0 = i == 0 ? 0.0 : std::max(
switchTimes_[i - 1], 0.0);
84 Real t0 = idx == 0 ? 0.0 : std::max(
switchTimes_[idx - 1], 0.0);
91 SurvivalProbabilityStructure::update();
95 const std::vector<Handle<DefaultProbabilityTermStructure> >
sourceCurves_;
std::vector< Time > switchTimes_
const std::vector< Date > switchDates_
const std::vector< Handle< DefaultProbabilityTermStructure > > sourceCurves_
const Date & referenceDate() const override
MultiSectionDefaultCurve(const std::vector< Handle< DefaultProbabilityTermStructure > > &sourceCurves, const std::vector< Handle< Quote > > recoveryRates, const std::vector< Date > &switchDates, const Handle< Quote > recoveryRate, const DayCounter &dayCounter, const bool extrapolate)
Date maxDate() const override
const Handle< Quote > recoveryRate_
Real survivalProbabilityImpl(Time t) const override
const std::vector< Handle< Quote > > recoveryRates_