QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
pathwiseproductinversefloater.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) 2009 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_market_model_pathwise_inverse_floater_hpp
22#define quantlib_market_model_pathwise_inverse_floater_hpp
23
24#include <ql/types.hpp>
28#include <vector>
29#include <memory>
30
31namespace QuantLib
32{
33
34 class EvolutionDescription;
35 class CurveState;
36
37 /*!
38 Pathwise product inverse floater for doing Greeks
39 Tested in MarketModels::testInverseFloater()
40
41 */
43 {
44 public:
45 MarketModelPathwiseInverseFloater(const std::vector<Time>& rateTimes,
46 std::vector<Real> fixedAccruals,
47 const std::vector<Real>& floatingAccruals,
48 const std::vector<Real>& fixedStrikes,
49 const std::vector<Real>& fixedMultipliers,
50 const std::vector<Real>& floatingSpreads,
51 const std::vector<Time>& paymentTimes,
52 bool payer = true);
53
55
56 std::vector<Size> suggestedNumeraires() const override;
57 const EvolutionDescription& evolution() const override;
58 std::vector<Time> possibleCashFlowTimes() const override;
59 Size numberOfProducts() const override;
61
62 // has division by the numeraire already been done?
63 bool alreadyDeflated() const override;
64
65
66 //! during simulation put product at start of path
67 void reset() override;
68
69 //! return value indicates whether path is finished, TRUE means done
70 bool nextTimeStep(const CurveState& currentState,
71 std::vector<Size>& numberCashFlowsThisStep,
72 std::vector<std::vector<MarketModelPathwiseMultiProduct::CashFlow> >&
73 cashFlowsGenerated) override;
74
75 //! returns a newly-allocated copy of itself
76 std::unique_ptr<MarketModelPathwiseMultiProduct> clone() const override;
77
78 private:
80 std::vector<Time> paymentTimes_;
81
84
86
87 // things that vary in a path
89
90 };
91}
92
93#endif
Curve state for market-model simulations
Definition: curvestate.hpp:41
Market-model evolution description.
std::vector< Size > suggestedNumeraires() const override
bool nextTimeStep(const CurveState &currentState, std::vector< Size > &numberCashFlowsThisStep, std::vector< std::vector< MarketModelPathwiseMultiProduct::CashFlow > > &cashFlowsGenerated) override
return value indicates whether path is finished, TRUE means done
std::unique_ptr< MarketModelPathwiseMultiProduct > clone() const override
returns a newly-allocated copy of itself
std::vector< Time > possibleCashFlowTimes() const override
const EvolutionDescription & evolution() const override
~MarketModelPathwiseInverseFloater() override=default
void reset() override
during simulation put product at start of path
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
Custom types.