QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
uscpi.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2009 Chris Kenyon
5 Copyright (C) 2021 Ralf Konrad Eckel
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
25#ifndef quantlib_uscpi_hpp
26#define quantlib_uscpi_hpp
27
28#include <ql/currencies/america.hpp>
29#include <ql/indexes/inflationindex.hpp>
30
31namespace QuantLib {
32
34 class USCPI : public ZeroInflationIndex {
35 public:
37 : ZeroInflationIndex("CPI",
38 USRegion(),
39 false,
40 Monthly,
41 Period(1, Months), // availability
43 ts) {}
44
48 QL_DEPRECATED
49 explicit USCPI(
50 bool interpolated,
52 : USCPI(ts) {
53 QL_DEPRECATED_DISABLE_WARNING
55 QL_DEPRECATED_ENABLE_WARNING
56 }
57 };
58
59
61 class YYUSCPI : public YoYInflationIndex {
62 public:
63 explicit YYUSCPI(
64 bool interpolated,
66 : YoYInflationIndex("YY_CPI",
67 USRegion(),
68 false,
70 Monthly,
71 Period(1, Months),
73 ts) {}
74 };
75
76
77 QL_DEPRECATED_DISABLE_WARNING
78
80
83 class [[deprecated("Pass the USCPI index to YoYInflationIndex instead")]] YYUSCPIr : public YoYInflationIndex {
84 public:
85 explicit YYUSCPIr(
86 bool interpolated,
88 : YoYInflationIndex("YYR_CPI",
89 USRegion(),
90 false,
91 interpolated,
92 true,
93 Monthly,
94 Period(1, Months),
96 ts) {}
97 };
98
99 QL_DEPRECATED_ENABLE_WARNING
100}
101
102
103#endif
Shared handle to an observable.
Definition: handle.hpp:41
QL_DEPRECATED bool interpolated() const
QL_DEPRECATED bool interpolated_
US CPI index.
Definition: uscpi.hpp:34
QL_DEPRECATED USCPI(bool interpolated, const Handle< ZeroInflationTermStructure > &ts={})
Definition: uscpi.hpp:49
USCPI(const Handle< ZeroInflationTermStructure > &ts={})
Definition: uscpi.hpp:36
U.S. dollar.
Definition: america.hpp:162
USA as geographical/economic region.
Definition: region.hpp:99
Quoted year-on-year US CPI (i.e. not a ratio of US CPI)
Definition: uscpi.hpp:61
YYUSCPI(bool interpolated, const Handle< YoYInflationTermStructure > &ts={})
Definition: uscpi.hpp:63
Year-on-year US CPI (i.e. a ratio of US CPI)
Definition: uscpi.hpp:83
YYUSCPIr(bool interpolated, const Handle< YoYInflationTermStructure > &ts={})
Definition: uscpi.hpp:85
Base class for year-on-year inflation indices.
Base class for zero inflation indices.
@ Monthly
once a month
Definition: frequency.hpp:44
Definition: any.hpp:35