28 std::vector<Real> fixedAccruals,
29 const std::vector<Real>& floatingAccruals,
30 const std::vector<Real>& fixedStrikes,
31 const std::vector<Real>& fixedMultipliers,
32 const std::vector<Real>& floatingSpreads,
33 const std::vector<Time>& paymentTimes,
36 floatingAccruals_(floatingAccruals), fixedStrikes_(fixedStrikes),
37 fixedMultipliers_(fixedMultipliers), floatingSpreads_(floatingSpreads),
38 paymentTimes_(paymentTimes), multiplier_(payer ? -1.0 : 1.0),
39 lastIndex_(rateTimes.size() - 1) {
42 QL_REQUIRE(floatingAccruals.size() ==
lastIndex_,
" Incorrect number of floatingAccruals given, should be " <<
lastIndex_ <<
" not " << floatingAccruals.size() );
43 QL_REQUIRE(fixedStrikes.size() ==
lastIndex_,
" Incorrect number of fixedStrikes given, should be " <<
lastIndex_ <<
" not " << fixedStrikes.size() );
44 QL_REQUIRE(fixedMultipliers.size() ==
lastIndex_,
" Incorrect number of fixedMultipliers given, should be " <<
lastIndex_ <<
" not " << fixedMultipliers.size() );
45 QL_REQUIRE(floatingSpreads.size() ==
lastIndex_,
" Incorrect number of floatingSpreads given, should be " <<
lastIndex_ <<
" not " << floatingSpreads.size() );
46 QL_REQUIRE(paymentTimes.size() ==
lastIndex_,
" Incorrect number of paymentTimes given, should be " <<
lastIndex_ <<
" not " << paymentTimes.size() );
51 std::vector<Size>& numberCashFlowsThisStep,
52 std::vector<std::vector<MarketModelMultiProduct::CashFlow> >&
60 genCashFlows[0][0].amount =
multiplier_*(inverseFloatingCoupon - floatingCoupon);
62 numberCashFlowsThisStep[0] = 1;
68 std::unique_ptr<MarketModelMultiProduct>
Curve state for market-model simulations
virtual Rate forwardRate(Size i) const =0
Multiple-step market-model product.
std::vector< Real > floatingAccruals_
std::unique_ptr< MarketModelMultiProduct > clone() const override
returns a newly-allocated copy of itself
std::vector< Real > fixedStrikes_
std::vector< Real > floatingSpreads_
std::vector< Real > fixedMultipliers_
bool nextTimeStep(const CurveState ¤tState, std::vector< Size > &numberCashFlowsThisStep, std::vector< std::vector< CashFlow > > &cashFlowsGenerated) override
return value indicates whether path is finished, TRUE means done
MultiStepInverseFloater(const std::vector< Time > &rateTimes, std::vector< Real > fixedAccruals, const std::vector< Real > &floatingAccruals, const std::vector< Real > &fixedStrikes, const std::vector< Real > &fixedMultipliers, const std::vector< Real > &floatingSpreads, const std::vector< Time > &paymentTimes, bool payer=true)
std::vector< Real > fixedAccruals_
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
void checkIncreasingTimes(const std::vector< Time > ×)
check for strictly increasing times, first time greater than zero