QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
lognormalcmswapratepc.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006, 2007 Ferdinando Ametrano
5 Copyright (C) 2006, 2007 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_swap_rate_pc_evolver_hpp
23#define quantlib_swap_rate_pc_evolver_hpp
24
25#include <ql/models/marketmodels/evolver.hpp>
26#include <ql/models/marketmodels/curvestates/cmswapcurvestate.hpp>
27#include <ql/models/marketmodels/driftcomputation/cmsmmdriftcalculator.hpp>
28
29namespace QuantLib {
30
31 class MarketModel;
32 class BrownianGenerator;
33 class BrownianGeneratorFactory;
34
37 public:
38 LogNormalCmSwapRatePc(Size spanningForwards,
39 const ext::shared_ptr<MarketModel>&,
41 const std::vector<Size>& numeraires,
42 Size initialStep = 0);
44
45 const std::vector<Size>& numeraires() const override;
46 Real startNewPath() override;
47 Real advanceStep() override;
48 Size currentStep() const override;
49 const CurveState& currentState() const override;
50 void setInitialState(const CurveState&) override;
52 private:
53 void setCMSwapRates(const std::vector<Real>& swapRates);
54 // inputs
56 ext::shared_ptr<MarketModel> marketModel_;
57 std::vector<Size> numeraires_;
59 ext::shared_ptr<BrownianGenerator> generator_;
60 // fixed variables
61 std::vector<std::vector<Real> > fixedDrifts_;
62 // working variables
67 std::vector<Real> drifts1_, drifts2_, initialDrifts_;
68 std::vector<Real> brownians_, correlatedBrownians_;
69 std::vector<Size> alive_;
70 // helper classes
71 std::vector<CMSMMDriftCalculator> calculators_;
72 };
73
74}
75
76#endif
Curve state for constant-maturity-swap market models
Curve state for market-model simulations
Definition: curvestate.hpp:41
void setCMSwapRates(const std::vector< Real > &swapRates)
const CurveState & currentState() const override
std::vector< std::vector< Real > > fixedDrifts_
ext::shared_ptr< MarketModel > marketModel_
std::vector< CMSMMDriftCalculator > calculators_
const std::vector< Size > & numeraires() const override
ext::shared_ptr< BrownianGenerator > generator_
void setInitialState(const CurveState &) override
Market-model evolver.
Definition: evolver.hpp:35
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