QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
zeroinflationcashflow.cpp
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) 2021 Ralf Konrad Eckel
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
24
25namespace QuantLib {
26
28 const ext::shared_ptr<ZeroInflationIndex>& index,
29 CPI::InterpolationType observationInterpolation,
30 const Date& startDate,
31 const Date& endDate,
32 const Period& observationLag,
33 const Date& paymentDate,
34 bool growthOnly)
35 : IndexedCashFlow(notional, index,
36 startDate - observationLag, endDate - observationLag,
37 paymentDate, growthOnly),
38 zeroInflationIndex_(index), interpolation_(observationInterpolation),
39 startDate_(startDate), endDate_(endDate), observationLag_(observationLag) {}
40
43 }
44
47 }
48
50 auto* v1 = dynamic_cast<Visitor<ZeroInflationCashFlow>*>(&v);
51 if (v1 != nullptr)
52 v1->visit(*this);
53 else
55 }
56
57}
degenerate base class for the Acyclic Visitor pattern
Definition: visitor.hpp:33
Concrete date class.
Definition: date.hpp:125
Cash flow dependent on an index ratio.
void accept(AcyclicVisitor &) override
Visitor for a specific class
Definition: visitor.hpp:40
virtual void visit(T &)=0
ext::shared_ptr< ZeroInflationIndex > zeroInflationIndex_
void accept(AcyclicVisitor &) override
ZeroInflationCashFlow(Real notional, const ext::shared_ptr< ZeroInflationIndex > &index, CPI::InterpolationType observationInterpolation, const Date &startDate, const Date &endDate, const Period &observationLag, const Date &paymentDate, bool growthOnly=false)
QL_REAL Real
real number
Definition: types.hpp:50
base classes for inflation indexes
Base classes for inflation term structures.
Definition: any.hpp:37
Calendar for reproducing theoretical calculations.
ext::shared_ptr< BlackVolTermStructure > v
static Real laggedFixing(const ext::shared_ptr< ZeroInflationIndex > &index, const Date &date, const Period &observationLag, InterpolationType interpolationType)
interpolated inflation fixing
InterpolationType
when you observe an index, how do you interpolate between fixings?
Cash flow dependent on an inflation index ratio (NOT a coupon, i.e. no accruals).