28 std::vector<Real> fixedAccruals,
29 std::vector<Real> floatingAccruals,
30 const std::vector<Time>& paymentTimes,
34 floatingAccruals_(
std::move(floatingAccruals)), paymentTimes_(paymentTimes),
35 fixedRate_(fixedRate), multiplier_(payer ? 1.0 : -1.0), lastIndex_(rateTimes.size() - 1) {
41 std::vector<Size>& numberCashFlowsThisStep,
42 std::vector<std::vector<MarketModelMultiProduct::CashFlow> >&
48 genCashFlows[0][0].amount =
52 genCashFlows[0][1].amount =
55 numberCashFlowsThisStep[0] = 2;
62 std::unique_ptr<MarketModelMultiProduct>
64 return std::unique_ptr<MarketModelMultiProduct>(
new MultiStepSwap(*
this));
Curve state for market-model simulations
virtual Rate forwardRate(Size i) const =0
Multiple-step market-model product.
MultiStepSwap(const std::vector< Time > &rateTimes, std::vector< Real > fixedAccruals, std::vector< Real > floatingAccruals, const std::vector< Time > &paymentTimes, Rate fixedRate, bool payer=true)
std::vector< Real > floatingAccruals_
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
std::vector< Real > fixedAccruals_
void checkIncreasingTimes(const std::vector< Time > ×)
check for strictly increasing times, first time greater than zero