QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
callspecifiedmultiproduct.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Mark Joshi
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20
21#ifndef quantlib_callspecified_multiproduct_hpp
22#define quantlib_callspecified_multiproduct_hpp
23
24#include <ql/models/marketmodels/evolutiondescription.hpp>
25#include <ql/models/marketmodels/multiproduct.hpp>
26#include <ql/methods/montecarlo/exercisestrategy.hpp>
27#include <ql/utilities/clone.hpp>
28#include <valarray>
29
30namespace QuantLib {
31
33 public:
39
40 std::vector<Size> suggestedNumeraires() const override;
41 const EvolutionDescription& evolution() const override;
42 std::vector<Time> possibleCashFlowTimes() const override;
43 Size numberOfProducts() const override;
45 void reset() override;
46 bool nextTimeStep(const CurveState& currentState,
47 std::vector<Size>& numberCashFlowsThisStep,
48 std::vector<std::vector<CashFlow> >& cashFlowsGenerated) override;
49 std::unique_ptr<MarketModelMultiProduct> clone() const override;
53 const MarketModelMultiProduct& rebate() const;
54 void enableCallability();
55 void disableCallability();
56 private:
61 std::vector<std::valarray<bool> > isPresent_;
62 std::vector<Time> cashFlowTimes_;
64 bool wasCalled_ = false;
65 std::vector<Size> dummyCashFlowsThisStep_;
66 std::vector<std::vector<CashFlow> > dummyCashFlowsGenerated_;
68 bool callable_ = true;
69 };
70
71}
72
73#endif
const ExerciseStrategy< CurveState > & strategy() const
std::vector< Size > suggestedNumeraires() const override
std::vector< std::vector< CashFlow > > dummyCashFlowsGenerated_
std::unique_ptr< MarketModelMultiProduct > clone() const override
returns a newly-allocated copy of itself
const MarketModelMultiProduct & underlying() const
bool nextTimeStep(const CurveState &currentState, std::vector< Size > &numberCashFlowsThisStep, std::vector< std::vector< CashFlow > > &cashFlowsGenerated) override
return value indicates whether path is finished, TRUE means done
std::vector< Time > possibleCashFlowTimes() const override
const EvolutionDescription & evolution() const override
Clone< ExerciseStrategy< CurveState > > strategy_
Clone< MarketModelMultiProduct > rebate_
Clone< MarketModelMultiProduct > underlying_
const MarketModelMultiProduct & rebate() const
std::vector< std::valarray< bool > > isPresent_
void reset() override
during simulation put product at start of path
cloning proxy to an underlying object
Definition: clone.hpp:40
Curve state for market-model simulations
Definition: curvestate.hpp:41
Market-model evolution description.
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35