QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
cashrebate.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 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_cash_rebate_hpp
22#define quantlib_market_model_cash_rebate_hpp
23
26#include <ql/math/matrix.hpp>
27
28namespace QuantLib
29{
30 /*!
31 Class to model receipt of a fixed cash amount once. Product terminates immediately.
32 Mainly useful as rebate received when another product is cancelled.
33
34 */
35
37 {
38 public:
40 const std::vector<Time>& paymentTimes,
41 Matrix amounts,
43 //! \name MarketModelMultiProduct interface
44 //@{
45 std::vector<Size> suggestedNumeraires() const override;
46 const EvolutionDescription& evolution() const override;
47 std::vector<Time> possibleCashFlowTimes() const override;
48 Size numberOfProducts() const override;
50 void reset() override;
51 bool nextTimeStep(const CurveState& currentState,
52 std::vector<Size>& numberCashFlowsThisStep,
53 std::vector<std::vector<CashFlow> >& cashFlowsGenerated) override;
54 std::unique_ptr<MarketModelMultiProduct> clone() const override;
55 //@}
56 private:
58 std::vector<Time> paymentTimes_;
61 // things that vary in a path
63 };
64
65}
66
67#endif
Curve state for market-model simulations
Definition: curvestate.hpp:41
Market-model evolution description.
std::vector< Time > paymentTimes_
Definition: cashrebate.hpp:58
std::vector< Size > suggestedNumeraires() const override
Definition: cashrebate.cpp:69
std::unique_ptr< MarketModelMultiProduct > clone() const override
returns a newly-allocated copy of itself
Definition: cashrebate.cpp:97
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
Definition: cashrebate.cpp:80
std::vector< Time > possibleCashFlowTimes() const override
Definition: cashrebate.cpp:48
const EvolutionDescription & evolution() const override
Definition: cashrebate.cpp:74
Size maxNumberOfCashFlowsPerProductPerStep() const override
Definition: cashrebate.cpp:58
EvolutionDescription evolution_
Definition: cashrebate.hpp:57
Size numberOfProducts() const override
Definition: cashrebate.cpp:53
void reset() override
during simulation put product at start of path
Definition: cashrebate.cpp:63
Matrix used in linear algebra.
Definition: matrix.hpp:41
std::size_t Size
size of a container
Definition: types.hpp:58
matrix used in linear algebra.
Definition: any.hpp:35