29 std::vector<Real> accruals,
30 const std::vector<Time>& paymentTimes,
38 gearingOfFloor_(gearingOfFloor), gearingOfFixing_(gearingOfFixing),
39 spreadOfFloor_(spreadOfFloor), spreadOfFixing_(spreadOfFixing),
40 multiplier_(payer ? 1.0 : -1.0), lastIndex_(rateTimes.size() - 1),
41 initialFloor_(initialFloor) {
47 std::vector<Size>& numberCashFlowsThisStep,
48 std::vector<std::vector<MarketModelMultiProduct::CashFlow> >&
56 genCashFlows[0][0].amount =
61 numberCashFlowsThisStep[0] = 1;
68 std::unique_ptr<MarketModelMultiProduct>
70 return std::unique_ptr<MarketModelMultiProduct>(
new MultiStepRatchet(*
this));
Curve state for market-model simulations
virtual Rate forwardRate(Size i) const =0
Multiple-step market-model product.
std::unique_ptr< MarketModelMultiProduct > clone() const override
returns a newly-allocated copy of itself
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
MultiStepRatchet(const std::vector< Time > &rateTimes, std::vector< Real > accruals, const std::vector< Time > &paymentTimes, Real gearingOfFloor, Real gearingOfFixing, Rate spreadOfFloor, Rate spreadOfFixing, Real initialFloor, bool payer=true)
std::vector< Real > accruals_
void checkIncreasingTimes(const std::vector< Time > ×)
check for strictly increasing times, first time greater than zero