/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2006 Mark Joshi This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received a copy of the license along with this program; if not, please email . The license is also available online at . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ #include #include #include #include #include #include #include #include #include #include #include namespace QuantLib { typedef MarketModelMultiProduct::CashFlow CashFlow; void collectNodeData(MarketModelEvolver& evolver, MarketModelMultiProduct& product, MarketModelNodeDataProvider& dataProvider, MarketModelExerciseValue& rebate, MarketModelExerciseValue& control, Size numberOfPaths, std::vector >& collectedData) { std::vector numerairesHeld; QL_REQUIRE(product.numberOfProducts() == 1, "a single product is required"); // TODO: check that all objects have compatible evolutions // (same rate times; evolution times for product, basis // system, rebate and control must be subsets of the passed // evolution times; rebate, control and basis system must have // the same exercise---not evolution---times) std::vector numberCashFlowsThisStep(1); std::vector > cashFlowsGenerated(1); cashFlowsGenerated[0].resize( product.maxNumberOfCashFlowsPerProductPerStep()); std::vector