30 first_(numberOfRates_),
31 discRatios_(numberOfRates_+1, 1.0),
32 forwardRates_(numberOfRates_),
33 cmSwapRates_(numberOfRates_),
34 cmSwapAnnuities_(numberOfRates_,rateTaus_[numberOfRates_-1]),
35 cotSwapRates_(numberOfRates_),
36 cotAnnuities_(numberOfRates_,
37 rateTaus_[numberOfRates_-1]),
38 firstCotAnnuityComped_(numberOfRates_)
42 Size firstValidIndex) {
46 rates.size() <<
" provided");
48 "first valid index must be less than " <<
50 firstValidIndex <<
" not allowed");
54 std::copy(rates.begin()+
first_, rates.end(),
71 Size firstValidIndex) {
73 "too many discount ratios: " <<
75 discRatios.size() <<
" provided");
77 "first valid index must be less than " <<
79 firstValidIndex <<
" not allowed");
83 std::copy(discRatios.begin()+
first_, discRatios.end(),
115 "invalid numeraire");
152 Size spanningForwards)
const {
155 "invalid numeraire");
166 Size spanningForwards)
const {
199 return std::unique_ptr<CurveState>(
new LMMCurveState(*
this));
Curve state for market-model simulations
std::vector< Time > rateTaus_
Curve state for Libor market models
const std::vector< Rate > & cmSwapRates(Size spanningForwards) const override
Real discountRatio(Size i, Size j) const override
std::vector< Rate > forwardRates_
void setOnForwardRates(const std::vector< Rate > &fwdRates, Size firstValidIndex=0)
void setOnDiscountRatios(const std::vector< DiscountFactor > &discRatios, Size firstValidIndex=0)
Rate cmSwapAnnuity(Size numeraire, Size i, Size spanningForwards) const override
Rate coterminalSwapRate(Size i) const override
Size firstCotAnnuityComped_
Rate forwardRate(Size i) const override
Rate cmSwapRate(Size i, Size spanningForwards) const override
std::vector< Rate > cmSwapRates_
LMMCurveState(const std::vector< Time > &rateTimes)
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
#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 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)