QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
onestepoptionlets.hpp
Go to the documentation of this file.
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_onestep_optionlets_hpp
23#define quantlib_onestep_optionlets_hpp
24
26#include <ql/shared_ptr.hpp>
27
28namespace QuantLib {
29
30 class Payoff;
31
33 public:
34 OneStepOptionlets(const std::vector<Time>& rateTimes,
35 std::vector<Real> accruals,
36 const std::vector<Time>& paymentTimes,
37 std::vector<ext::shared_ptr<Payoff> >);
38 //! \name MarketModelMultiProduct interface
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;
48 //@}
49 private:
50 std::vector<Real> accruals_;
51 std::vector<Time> paymentTimes_;
52 std::vector<ext::shared_ptr<Payoff> > payoffs_;
53 };
54
55 // inline definitions
56
57 inline std::vector<Time>
59 return paymentTimes_;
60 }
61
63 return payoffs_.size();
64 }
65
66 inline Size
68 return 1;
69 }
70
72 // nothing to do
73 }
74
75}
76
77#endif
Curve state for market-model simulations
Definition: curvestate.hpp:41
Single-step market-model product.
std::vector< Time > paymentTimes_
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
Maps shared_ptr to either the boost or std implementation.