QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
multistepoptionlets.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Ferdinando Ametrano
5 Copyright (C) 2006 Mark Joshi
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21
22#ifndef quantlib_multistep_optionlets_hpp
23#define quantlib_multistep_optionlets_hpp
24
25#include <ql/models/marketmodels/products/multiproductmultistep.hpp>
26#include <ql/shared_ptr.hpp>
27
28namespace QuantLib {
29
30 class Payoff;
31
33 public:
34 MultiStepOptionlets(const std::vector<Time>& rateTimes,
35 std::vector<Real> accruals,
36 const std::vector<Time>& paymentTimes,
37 std::vector<ext::shared_ptr<Payoff> >);
39
40 std::vector<Time> possibleCashFlowTimes() const override;
41 Size numberOfProducts() const override;
43 void reset() override;
44 bool nextTimeStep(const CurveState& currentState,
45 std::vector<Size>& numberCashFlowsThisStep,
46 std::vector<std::vector<CashFlow> >& cashFlowsGenerated) override;
47 std::unique_ptr<MarketModelMultiProduct> clone() const override;
49 private:
50 std::vector<Real> accruals_;
51 std::vector<Time> paymentTimes_;
52 std::vector<ext::shared_ptr<Payoff> > payoffs_;
53 // things that vary in a path
55 };
56
57 // inline definitions
58
59 inline std::vector<Time>
61 return paymentTimes_;
62 }
63
65 return payoffs_.size();
66 }
67
68 inline Size
70 return 1;
71 }
72
75 }
76
77}
78
79#endif
Curve state for market-model simulations
Definition: curvestate.hpp:41
Multiple-step market-model product.
std::unique_ptr< MarketModelMultiProduct > clone() const override
returns a newly-allocated copy of itself
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< ext::shared_ptr< Payoff > > payoffs_
std::vector< Time > possibleCashFlowTimes() const override
Size maxNumberOfCashFlowsPerProductPerStep() const override
Size numberOfProducts() const override
void reset() override
during simulation put product at start of path
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35