24#ifndef quantext_statically_corrected_yts_hpp
25#define quantext_statically_corrected_yts_hpp
29#include <ql/termstructures/yieldtermstructure.hpp>
31#include <boost/unordered_map.hpp>
50 const Handle<YieldTermStructure>& fixedSourceTermStructure,
51 const Handle<YieldTermStructure>& fixedTargetTermStructure,
53 : YieldTermStructure(floatingTermStructure->dayCounter()),
x_(floatingTermStructure),
55 registerWith(floatingTermStructure);
56 registerWith(fixedSourceTermStructure);
57 registerWith(fixedTargetTermStructure);
60 Date
maxDate()
const override {
return x_->maxDate(); }
64 Calendar
calendar()
const override {
return x_->calendar(); }
82 boost::hash_combine(seed, x.
t0);
83 boost::hash_combine(seed, x.
t);
87 mutable boost::unordered_map<cache_key, Real, cache_hasher>
cache_c_;
102 boost::unordered_map<cache_key, Real>::const_iterator i =
cache_c_.find(k);
105 cache_c_.insert(std::make_pair(k, c));
113 boost::unordered_map<cache_key, Real>::const_iterator i =
cache_c_.find(k);
116 cache_c_.insert(std::make_pair(k, c));
121 return x_->discount(t) * c;
Statically Corrected Yield Term Structure.
const Handle< YieldTermStructure > x_
Calendar calendar() const override
const YieldCurveRollDown rollDown_
const Date & referenceDate() const override
boost::unordered_map< cache_key, Real, cache_hasher > cache_c_
Natural settlementDays() const override
Date maxDate() const override
Real discountImpl(Time t) const override
const Handle< YieldTermStructure > target_
StaticallyCorrectedYieldTermStructure(const Handle< YieldTermStructure > &floatingTermStructure, const Handle< YieldTermStructure > &fixedSourceTermStructure, const Handle< YieldTermStructure > &fixedTargetTermStructure, const YieldCurveRollDown &rollDown=ForwardForward)
const Handle< YieldTermStructure > source_
dynamics type definitions
YieldCurveRollDown
Yield Curve Roll Down.
std::size_t operator()(cache_key const &x) const
bool operator==(const cache_key &o) const