26#ifndef quantlib_piecewise_yield_curve_hpp
27#define quantlib_piecewise_yield_curve_hpp
37 class MultiCurveSensitivities;
60 template <
class Traits,
class Interpolator,
61 template <
class>
class Bootstrap = IterativeBootstrap>
63 :
public Traits::template curve<Interpolator>::type,
66 typedef typename Traits::template curve<Interpolator>::type
base_curve;
76 const Date& referenceDate,
77 std::vector<ext::shared_ptr<typename Traits::helper> > instruments,
80 const std::vector<Date>& jumpDates = {},
81 const Interpolator& i = {},
83 :
base_curve(referenceDate, dayCounter, jumps, jumpDates, i),
90 std::vector<ext::shared_ptr<typename Traits::helper> > instruments,
92 const Interpolator& i,
95 referenceDate, dayCounter, {}, {}, i),
102 std::vector<ext::shared_ptr<typename Traits::helper> > instruments,
115 std::vector<ext::shared_ptr<typename Traits::helper> > instruments,
118 const std::vector<Date>& jumpDates = {},
119 const Interpolator& i = {},
121 :
base_curve(settlementDays, calendar, dayCounter, jumps, jumpDates, i),
129 std::vector<ext::shared_ptr<typename Traits::helper> > instruments,
131 const Interpolator& i,
147 const std::vector<ext::shared_ptr<typename Traits::helper> >&
151 :
base_curve(settlementDays, calendar, dayCounter),
163 const std::vector<Time>&
times()
const;
164 const std::vector<Date>&
dates()
const;
165 const std::vector<Real>&
data()
const;
166 std::vector<std::pair<Date, Real> >
nodes()
const;
197 template <
class C,
class I,
template <
class>
class B>
200 return base_curve::maxDate();
203 template <
class C,
class I,
template <
class>
class B>
206 return base_curve::times();
209 template <
class C,
class I,
template <
class>
class B>
212 return base_curve::dates();
215 template <
class C,
class I,
template <
class>
class B>
218 return base_curve::data();
221 template <
class C,
class I,
template <
class>
class B>
222 inline std::vector<std::pair<Date, Real> >
225 return base_curve::nodes();
228 template <
class C,
class I,
template <
class>
class B>
238 this->updated_ =
false;
242 template <
class C,
class I,
template <
class>
class B>
246 return base_curve::discountImpl(
t);
249 template <
class C,
class I,
template <
class>
class B>
252 bootstrap_.calculate();
Shared handle to an observable.
Framework for calculation on demand and result caching.
Piecewise yield term structure.
void performCalculations() const override
PiecewiseYieldCurve(Natural settlementDays, const Calendar &calendar, const std::vector< ext::shared_ptr< typename Traits::helper > > &instruments, const DayCounter &dayCounter, const bootstrap_type &bootstrap)
PiecewiseYieldCurve(const Date &referenceDate, std::vector< ext::shared_ptr< typename Traits::helper > > instruments, const DayCounter &dayCounter, const std::vector< Handle< Quote > > &jumps={}, const std::vector< Date > &jumpDates={}, const Interpolator &i={}, bootstrap_type bootstrap={})
PiecewiseYieldCurve(const Date &referenceDate, std::vector< ext::shared_ptr< typename Traits::helper > > instruments, const DayCounter &dayCounter, bootstrap_type bootstrap)
PiecewiseYieldCurve< Traits, Interpolator, Bootstrap > this_curve
Traits::template curve< Interpolator >::type base_curve
Bootstrap< this_curve > bootstrap_
PiecewiseYieldCurve(Natural settlementDays, const Calendar &calendar, std::vector< ext::shared_ptr< typename Traits::helper > > instruments, const DayCounter &dayCounter, const Interpolator &i, bootstrap_type bootstrap=bootstrap_type())
const std::vector< Date > & dates() const
const std::vector< Real > & data() const
std::vector< std::pair< Date, Real > > nodes() const
Interpolator interpolator_type
const std::vector< Time > & times() const
std::vector< ext::shared_ptr< typename Traits::helper > > instruments_
DiscountFactor discountImpl(Time) const override
Date maxDate() const override
PiecewiseYieldCurve(Natural settlementDays, const Calendar &calendar, std::vector< ext::shared_ptr< typename Traits::helper > > instruments, const DayCounter &dayCounter, const std::vector< Handle< Quote > > &jumps={}, const std::vector< Date > &jumpDates={}, const Interpolator &i={}, bootstrap_type bootstrap={})
friend class Bootstrap< this_curve >
friend class MultiCurveSensitivities
PiecewiseYieldCurve(const Date &referenceDate, std::vector< ext::shared_ptr< typename Traits::helper > > instruments, const DayCounter &dayCounter, const Interpolator &i, bootstrap_type bootstrap=bootstrap_type())
Bootstrap< this_curve > bootstrap_type
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
unsigned QL_INTEGER Natural
positive integer
universal piecewise-term-structure boostrapper.
framework for calculation on demand and result caching
localised-term-structure bootstrapper for most curve types.