31 ext::shared_ptr<StrikedTypePayoff> & payOff)
33 startIndex_(startIndex), endIndex_(endIndex),
payoff_(payOff)
44 std::vector<Size>& numberCashFlowsThisStep,
45 std::vector<std::vector<MarketModelMultiProduct::CashFlow> >&
50 genCashFlows[0][0].timeIndex = 0;
56 genCashFlows[0][0].amount =
57 (*payoff_)(swapRate) * annuity;
59 numberCashFlowsThisStep[0] =genCashFlows[0][0].amount != 0.0 ? 1 : 0 ;
65 numberCashFlowsThisStep[0] =0;
71 std::unique_ptr<MarketModelMultiProduct>
Curve state for market-model simulations
virtual Rate cmSwapRate(Size i, Size spanningForwards) const =0
virtual Rate cmSwapAnnuity(Size numeraire, Size i, Size spanningForwards) const =0
Multiple-step market-model product.
std::vector< Time > paymentTimes_
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
MultiStepSwaption(const std::vector< Time > &rateTimes, Size startIndex, Size endIndex, ext::shared_ptr< StrikedTypePayoff > &)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
const ext::shared_ptr< Payoff > payoff_
std::size_t Size
size of a container
Payoffs for various options.