33 const std::vector<Rate>& strikes)
34 : rateTimes_(rateTimes),
36 numberRates_(rateTimes.size()-1)
43 "rateTimes.size()<> numberOfRates+1");
46 "strikes.size()<> numberOfRates");
55 std::vector<Size>& numberCashFlowsThisStep,
56 std::vector<std::vector<MarketModelPathwiseMultiProduct::CashFlow> >& cashFlowsGenerated)
65 std::fill(numberCashFlowsThisStep.begin(),
66 numberCashFlowsThisStep.end(),0);
89 std::unique_ptr<MarketModelPathwiseMultiProduct>
140 const std::vector<Rate>& strikes,
142 : rateTimes_(rateTimes),
144 numberRates_(rateTimes.size()-1), bumpSize_(bumpSize), up_(rateTimes), down_(rateTimes), forwards_(numberRates_)
148 evolTimes.pop_back();
151 "rateTimes.size()<> numberOfRates+1");
154 "strikes.size()<> numberOfRates");
163 std::vector<Size>& numberCashFlowsThisStep,
164 std::vector<std::vector<MarketModelPathwiseMultiProduct::CashFlow> >& cashFlowsGenerated)
173 std::fill(numberCashFlowsThisStep.begin(),
174 numberCashFlowsThisStep.end(),0);
210 std::unique_ptr<MarketModelPathwiseMultiProduct>
213 return std::unique_ptr<MarketModelPathwiseMultiProduct>(
Curve state for market-model simulations
virtual Rate coterminalSwapAnnuity(Size numeraire, Size i) const =0
virtual Rate forwardRate(Size i) const =0
virtual const std::vector< Rate > & forwardRates() const =0
virtual Rate coterminalSwapRate(Size i) const =0
virtual Real discountRatio(Size i, Size j) const =0
Market-model evolution description.
void setOnForwardRates(const std::vector< Rate > &fwdRates, Size firstValidIndex=0)
Rate coterminalSwapRate(Size i) const override
Rate coterminalSwapAnnuity(Size numeraire, Size i) const override
std::vector< Size > suggestedNumeraires() const override
MarketModelPathwiseCoterminalSwaptionsDeflated(const std::vector< Time > &rateTimes, const std::vector< Rate > &strikes)
bool nextTimeStep(const CurveState ¤tState, std::vector< Size > &numberCashFlowsThisStep, std::vector< std::vector< MarketModelPathwiseMultiProduct::CashFlow > > &cashFlowsGenerated) override
return value indicates whether path is finished, TRUE means done
std::unique_ptr< MarketModelPathwiseMultiProduct > clone() const override
returns a newly-allocated copy of itself
bool alreadyDeflated() const override
std::vector< Time > possibleCashFlowTimes() const override
const EvolutionDescription & evolution() const override
Size maxNumberOfCashFlowsPerProductPerStep() const override
EvolutionDescription evolution_
Size numberOfProducts() const override
std::vector< Rate > strikes_
std::vector< Real > rateTimes_
void reset() override
during simulation put product at start of path
std::vector< Size > suggestedNumeraires() const override
MarketModelPathwiseCoterminalSwaptionsNumericalDeflated(const std::vector< Time > &rateTimes, const std::vector< Rate > &strikes, Real bumpSize_)
std::vector< Rate > forwards_
bool nextTimeStep(const CurveState ¤tState, std::vector< Size > &numberCashFlowsThisStep, std::vector< std::vector< MarketModelPathwiseMultiProduct::CashFlow > > &cashFlowsGenerated) override
return value indicates whether path is finished, TRUE means done
std::unique_ptr< MarketModelPathwiseMultiProduct > clone() const override
returns a newly-allocated copy of itself
bool alreadyDeflated() const override
std::vector< Time > possibleCashFlowTimes() const override
const EvolutionDescription & evolution() const override
Size maxNumberOfCashFlowsPerProductPerStep() const override
EvolutionDescription evolution_
Size numberOfProducts() const override
std::vector< Rate > strikes_
std::vector< Real > rateTimes_
void reset() override
during simulation put product at start of path
#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 checkIncreasingTimes(const std::vector< Time > ×)
check for strictly increasing times, first time greater than zero