32 result += component.product->maxNumberOfCashFlowsPerProductPerStep();
39 std::vector<Size>& numberCashFlowsThisStep,
40 std::vector<std::vector<CashFlow> >& cashFlowsGenerated) {
43 Size n = 0, totalCashflows = 0;
48 bool thisDone = i->product->nextTimeStep(currentState,
54 for (
Size j=0; j<i->product->numberOfProducts(); ++j) {
55 Size offset = totalCashflows;
56 totalCashflows += i->numberOfCashflows[j];
57 for (
Size k=0; k<i->numberOfCashflows[j]; ++k) {
59 CashFlow& to = cashFlowsGenerated[0][k+offset];
63 numberCashFlowsThisStep[0] = totalCashflows;
66 done = done && thisDone;
73 std::unique_ptr<MarketModelMultiProduct>
Curve state for market-model simulations
std::vector< std::valarray< bool > > isInSubset_
std::vector< SubProduct > components_
Composition of one or more market-model products.
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
Size maxNumberOfCashFlowsPerProductPerStep() const override
Size numberOfProducts() const override
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container