24 const std::vector<Size>& stateProcessProjection,
25 const QuantLib::ext::shared_ptr<std::vector<std::vector<QuantLib::Path>>>& bufferedPaths)
26 : stateProcessProjection_(stateProcessProjection), bufferedPaths_(bufferedPaths), next_(MultiPath(), 1.0) {
28 QL_REQUIRE(
bufferedPaths_,
"ProjectedBufferedMultiPathGenerator: no buffered paths given (null)");
29 QL_REQUIRE(!
bufferedPaths_->empty(),
"ProjectedBufferedMultiPathGenerator: at least one buffered path required");
31 QL_REQUIRE(!stateProcessProjection.empty(),
32 "ProjectedBufferedMultiPathGenerator: state process projection is empty");
34 maxTargetIndex_ = *std::max_element(stateProcessProjection.begin(), stateProcessProjection.end());
40 QL_REQUIRE(currentPath_ < bufferedPaths_->size(),
41 "ProjectedBufferedMultiPathGenerator: run out of paths (" <<
bufferedPaths_->size() <<
")");
44 "ProjectedBufferedMultiPathGenerator: buffered path at sample "
48 std::vector<Path> tmp;
54 next_.value = MultiPath(tmp);
const QuantLib::ext::shared_ptr< std::vector< std::vector< QuantLib::Path > > > bufferedPaths_
Sample< MultiPath > next_
ProjectedBufferedMultiPathGenerator(const std::vector< Size > &stateProcessProjection, const QuantLib::ext::shared_ptr< std::vector< std::vector< QuantLib::Path > > > &bufferedPaths)
const std::vector< Size > stateProcessProjection_
const Sample< MultiPath > & next() const override
multi path generator projecting paths from a buffered state processr