27 result += component.product->numberOfProducts();
35 result = std::max(result, component.product->maxNumberOfCashFlowsPerProductPerStep());
42 std::vector<Size>& numberCashFlowsThisStep,
43 std::vector<std::vector<CashFlow> >& cashFlowsGenerated) {
46 Size n = 0, offset = 0;
51 bool thisDone = i->product->nextTimeStep(currentState,
57 for (
Size j=0; j<i->product->numberOfProducts(); ++j) {
58 numberCashFlowsThisStep[j+offset] =
59 i->numberOfCashflows[j];
60 for (
Size k=0; k<i->numberOfCashflows[j]; ++k) {
62 CashFlow& to = cashFlowsGenerated[j+offset][k];
68 done = done && thisDone;
71 for (
Size j=0; j<i->product->numberOfProducts(); ++j)
72 numberCashFlowsThisStep[j+offset] =0;
75 offset += i->product->numberOfProducts();
81 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