27 Size spanningForwards)
29 spanningFwds_(spanningForwards),
30 first_(numberOfRates_),
31 discRatios_(numberOfRates_+1, 1.0),
32 forwardRates_(numberOfRates_),
33 cmSwapRates_(numberOfRates_),
34 cmSwapAnnuities_(numberOfRates_, rateTaus_[numberOfRates_-1]),
35 irrCMSwapRates_(numberOfRates_),
36 irrCMSwapAnnuities_(numberOfRates_, rateTaus_[numberOfRates_-1]),
37 cotSwapRates_(numberOfRates_),
38 cotAnnuities_(numberOfRates_, rateTaus_[numberOfRates_-1]) {}
41 Size firstValidIndex) {
45 rates.size() <<
" provided");
47 "first valid index must be less than " <<
49 firstValidIndex <<
" not allowed");
53 std::copy(rates.begin()+
first_, rates.end(),
74 if (annuityEndIndex < oldAnnuityEndIndex)
77 oldAnnuityEndIndex = annuityEndIndex;
105 "invalid numeraire");
124 Size spanningForwards)
const{
127 "invalid numeraire");
141 Size spanningForwards)
const {
Curve state for constant-maturity-swap market models
const std::vector< Rate > & cmSwapRates(Size spanningForwards) const override
Real discountRatio(Size i, Size j) const override
std::vector< Rate > forwardRates_
Rate cmSwapAnnuity(Size numeraire, Size i, Size spanningForwards) const override
std::vector< Real > irrCMSwapAnnuities_
Rate coterminalSwapRate(Size i) const override
Rate forwardRate(Size i) const override
Rate cmSwapRate(Size i, Size spanningForwards) const override
std::vector< Rate > irrCMSwapRates_
std::vector< Rate > cmSwapRates_
CMSwapCurveState(const std::vector< Time > &rateTimes, Size spanningForwards)
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_
void setOnCMSwapRates(const std::vector< Rate > &cmSwapRates, Size firstValidIndex=0)
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
QL_INTEGER Integer
integer number
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 coterminalFromDiscountRatios(const Size firstValidIndex, const std::vector< DiscountFactor > &discountFactors, const std::vector< Time > &taus, std::vector< Rate > &cotSwapRates, std::vector< Real > &cotSwapAnnuities)
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)