27 const std::vector<Time>& rateTimes)
29 first_(numberOfRates_),
30 discRatios_(numberOfRates_+1, 1.0),
31 forwardRates_(numberOfRates_),
32 cmSwapRates_(numberOfRates_),
33 cmSwapAnnuities_(numberOfRates_, rateTaus_[numberOfRates_-1]),
34 cotSwapRates_(numberOfRates_),
35 cotAnnuities_(numberOfRates_, rateTaus_[numberOfRates_-1]) {}
38 const std::vector<Rate>& rates,
39 Size firstValidIndex) {
43 rates.size() <<
" provided");
45 "first valid index must be less than " <<
47 firstValidIndex <<
" not allowed");
50 std::copy(rates.begin()+
first_, rates.end(),
99 Size spanningForwards)
const {
102 "invalid numeraire");
113 Size spanningForwards)
const {
143 std::unique_ptr<CurveState>
Curve state for coterminal-swap market models
const std::vector< Rate > & cmSwapRates(Size spanningForwards) const override
void setOnCoterminalSwapRates(const std::vector< Rate > &swapRates, Size firstValidIndex=0)
Real discountRatio(Size i, Size j) const override
std::vector< Rate > forwardRates_
CoterminalSwapCurveState(const std::vector< Time > &rateTimes)
Rate cmSwapAnnuity(Size numeraire, Size i, Size spanningForwards) const override
Rate coterminalSwapRate(Size i) const override
Rate forwardRate(Size i) const override
Rate cmSwapRate(Size i, Size spanningForwards) const override
std::vector< Rate > cmSwapRates_
std::vector< Rate > cotSwapRates_
Rate coterminalSwapAnnuity(Size numeraire, Size i) const override
std::vector< Real > cmSwapAnnuities_
const std::vector< Rate > & forwardRates() const override
std::vector< DiscountFactor > discRatios_
std::unique_ptr< CurveState > clone() const override
std::vector< Real > cotAnnuities_
const std::vector< Rate > & coterminalSwapRates() const override
Curve state for market-model simulations
std::vector< Time > rateTaus_
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container
void forwardsFromDiscountRatios(const Size firstValidIndex, const std::vector< DiscountFactor > &ds, const std::vector< Time > &taus, std::vector< Rate > &fwds)
void constantMaturityFromDiscountRatios(const Size spanningForwards, const Size firstValidIndex, const std::vector< DiscountFactor > &ds, const std::vector< Time > &taus, std::vector< Rate > &constMatSwapRates, std::vector< Real > &constMatSwapAnnuities)