QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
uscpi.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 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
21/*! \file uscpi.hpp
22 \brief US CPI index
23 */
24
25#ifndef quantlib_uscpi_hpp
26#define quantlib_uscpi_hpp
27
30
31namespace QuantLib {
32
33 //! US CPI index
34 class USCPI : public ZeroInflationIndex {
35 public:
37 : ZeroInflationIndex("CPI",
38 USRegion(),
39 false,
40 Monthly,
41 Period(1, Months), // availability
43 ts) {}
44 };
45
46
47 //! Quoted year-on-year US CPI (i.e. not a ratio of US CPI)
48 class YYUSCPI : public YoYInflationIndex {
49 public:
50 explicit YYUSCPI(
51 bool interpolated,
53 : YoYInflationIndex("YY_CPI",
54 USRegion(),
55 false,
57 Monthly,
58 Period(1, Months),
60 ts) {}
61 };
62
63
65
66 //! Year-on-year US CPI (i.e. a ratio of US CPI)
67 /*! \deprecated Pass the USCPI index to YoYInflationIndex instead.
68 Deprecated in version 1.31.
69 */
70 class [[deprecated("Pass the USCPI index to YoYInflationIndex instead")]] YYUSCPIr : public YoYInflationIndex {
71 public:
72 explicit YYUSCPIr(
73 bool interpolated,
75 : YoYInflationIndex("YYR_CPI",
76 USRegion(),
77 false,
78 interpolated,
79 true,
80 Monthly,
81 Period(1, Months),
83 ts) {}
84 };
85
87}
88
89
90#endif
American currencies.
Shared handle to an observable.
Definition: handle.hpp:41
US CPI index.
Definition: uscpi.hpp:34
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:48
YYUSCPI(bool interpolated, const Handle< YoYInflationTermStructure > &ts={})
Definition: uscpi.hpp:50
Year-on-year US CPI (i.e. a ratio of US CPI)
Definition: uscpi.hpp:70
YYUSCPIr(bool interpolated, const Handle< YoYInflationTermStructure > &ts={})
Definition: uscpi.hpp:72
Base class for year-on-year inflation indices.
Base class for zero inflation indices.
@ Monthly
once a month
Definition: frequency.hpp:44
base classes for inflation indexes
Definition: any.hpp:35
#define QL_DEPRECATED_DISABLE_WARNING
Definition: qldefines.hpp:216
#define QL_DEPRECATED_ENABLE_WARNING
Definition: qldefines.hpp:217