File: class_quant_lib_1_1_day_counter.html

package info (click to toggle)
quantlib-refman-html 1.20-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 103,140 kB
  • sloc: javascript: 13,408; makefile: 35
file content (286 lines) | stat: -rw-r--r-- 19,436 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QuantLib: DayCounter Class Reference</title>
<link href='https://fonts.googleapis.com/css?family=Merriweather+Sans:800' rel='stylesheet' type='text/css'>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="quantlibextra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="http://quantlib.org">
       <img alt="QuantLib" src="QL-title.jpg"></a>
   <div id="projectbrief">A free/open-source library for quantitative finance</div>
   <div id="projectnumber">Reference manual - version 1.20</div>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespace_quant_lib.html">QuantLib</a></li><li class="navelem"><a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#related">Related Functions</a> &#124;
<a href="class_quant_lib_1_1_day_counter-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">DayCounter Class Reference<div class="ingroups"><a class="el" href="group__datetime.html">Date and time calculations</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>day counter class  
 <a href="class_quant_lib_1_1_day_counter.html#details">More...</a></p>

<p><code>#include &lt;ql/time/daycounter.hpp&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for DayCounter:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="class_quant_lib_1_1_day_counter__inherit__graph.png" border="0" usemap="#a_day_counter_inherit__map" alt="Inheritance graph"/></div>
<map name="_day_counter_inherit__map" id="a_day_counter_inherit__map">
<area shape="rect" title="day counter class" alt="" coords="5,208,97,235"/>
<area shape="rect" href="class_quant_lib_1_1_actual360.html" title="Actual/360 day count convention." alt="" coords="171,5,251,32"/>
<area shape="rect" href="class_quant_lib_1_1_actual364.html" title="Actual/364 day count convention." alt="" coords="171,56,251,83"/>
<area shape="rect" href="class_quant_lib_1_1_actual365_fixed.html" title="Actual/365 (Fixed) day count convention." alt="" coords="155,107,267,133"/>
<area shape="rect" href="class_quant_lib_1_1_actual_actual.html" title="Actual/Actual day count." alt="" coords="163,157,259,184"/>
<area shape="rect" href="class_quant_lib_1_1_business252.html" title="Business/252 day count convention." alt="" coords="163,208,260,235"/>
<area shape="rect" href="class_quant_lib_1_1_one_day_counter.html" title="1/1 day count convention" alt="" coords="153,259,269,285"/>
<area shape="rect" href="class_quant_lib_1_1_simple_day_counter.html" title="Simple day counter for reproducing theoretical calculations." alt="" coords="145,309,277,336"/>
<area shape="rect" href="class_quant_lib_1_1_thirty360.html" title="30/360 day count convention" alt="" coords="173,360,249,387"/>
<area shape="rect" href="class_quant_lib_1_1_thirty365.html" title="30/365 day count convention" alt="" coords="173,411,249,437"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter_1_1_impl.html">Impl</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">abstract base class for day counter implementations  <a href="class_quant_lib_1_1_day_counter_1_1_impl.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4c13117cd5659354dad5d3a3d4b36925"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a4c13117cd5659354dad5d3a3d4b36925">DayCounter</a> ()</td></tr>
<tr class="separator:a4c13117cd5659354dad5d3a3d4b36925"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">DayCounter interface</div></td></tr>
<tr class="memitem:a644718bb2fb240de962dc3c9a1fdf0dc"><td class="memItemLeft" align="right" valign="top"><a id="a644718bb2fb240de962dc3c9a1fdf0dc"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a644718bb2fb240de962dc3c9a1fdf0dc">empty</a> () const</td></tr>
<tr class="memdesc:a644718bb2fb240de962dc3c9a1fdf0dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether or not the day counter is initialized. <br /></td></tr>
<tr class="separator:a644718bb2fb240de962dc3c9a1fdf0dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d89c28bd42ba9a52da008bb69367171"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a1d89c28bd42ba9a52da008bb69367171">name</a> () const</td></tr>
<tr class="memdesc:a1d89c28bd42ba9a52da008bb69367171"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the name of the day counter.  <a href="class_quant_lib_1_1_day_counter.html#a1d89c28bd42ba9a52da008bb69367171">More...</a><br /></td></tr>
<tr class="separator:a1d89c28bd42ba9a52da008bb69367171"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1030acc5095401c041d13d1c3fb9d9c6"><td class="memItemLeft" align="right" valign="top"><a id="a1030acc5095401c041d13d1c3fb9d9c6"></a>
<a class="el" href="class_quant_lib_1_1_date.html#a4c0b362accace7d0490c5ededaef9a2e">Date::serial_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a1030acc5095401c041d13d1c3fb9d9c6">dayCount</a> (const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;) const</td></tr>
<tr class="memdesc:a1030acc5095401c041d13d1c3fb9d9c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of days between two dates. <br /></td></tr>
<tr class="separator:a1030acc5095401c041d13d1c3fb9d9c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28170faaec75755611ff6fc220c1fab8"><td class="memItemLeft" align="right" valign="top"><a id="a28170faaec75755611ff6fc220c1fab8"></a>
<a class="el" href="group__types.html#ga14fb8fca43a68f4168654e1f9f7e22f7">Time</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a28170faaec75755611ff6fc220c1fab8">yearFraction</a> (const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;refPeriodStart=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>(), const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;refPeriodEnd=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>()) const</td></tr>
<tr class="memdesc:a28170faaec75755611ff6fc220c1fab8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the period between two dates as a fraction of year. <br /></td></tr>
<tr class="separator:a28170faaec75755611ff6fc220c1fab8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:aaa4f1efef860b6bb4fcd980868483229"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#aaa4f1efef860b6bb4fcd980868483229">DayCounter</a> (const ext::shared_ptr&lt; <a class="el" href="class_quant_lib_1_1_day_counter_1_1_impl.html">Impl</a> &gt; &amp;impl)</td></tr>
<tr class="separator:aaa4f1efef860b6bb4fcd980868483229"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ac29a938cdc70db8abcde7a84fe62f9b4"><td class="memItemLeft" align="right" valign="top"><a id="ac29a938cdc70db8abcde7a84fe62f9b4"></a>
ext::shared_ptr&lt; <a class="el" href="class_quant_lib_1_1_day_counter_1_1_impl.html">Impl</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>impl_</b></td></tr>
<tr class="separator:ac29a938cdc70db8abcde7a84fe62f9b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="related"></a>
Related Functions</h2></td></tr>
<tr><td class="ititle" colspan="2"><p>(Note that these are not member functions.) </p>
</td></tr>
<tr class="memitem:acbca520b46832e1a53e72053c233692c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#acbca520b46832e1a53e72053c233692c">operator==</a> (const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &amp;, const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &amp;)</td></tr>
<tr class="separator:acbca520b46832e1a53e72053c233692c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f7511e2a309e1588a2f300def9b495c"><td class="memItemLeft" align="right" valign="top"><a id="a0f7511e2a309e1588a2f300def9b495c"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator!=</b> (const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &amp;, const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &amp;)</td></tr>
<tr class="separator:a0f7511e2a309e1588a2f300def9b495c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68dd78dd1968d9b0c1d0702a6f3be500"><td class="memItemLeft" align="right" valign="top"><a id="a68dd78dd1968d9b0c1d0702a6f3be500"></a>
std::ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator&lt;&lt;</b> (std::ostream &amp;, const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &amp;)</td></tr>
<tr class="separator:a68dd78dd1968d9b0c1d0702a6f3be500"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>day counter class </p>
<p>This class provides methods for determining the length of a time period according to given market convention, both as a number of days and as a year fraction.</p>
<p>The Bridge pattern is used to provide the base behavior of the day counter. </p>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="_bermudan_swaption_8cpp-example.html#_a17">BermudanSwaption.cpp</a>, <a class="el" href="_bonds_8cpp-example.html#_a10">Bonds.cpp</a>, <a class="el" href="_callable_bonds_8cpp-example.html#_a1">CallableBonds.cpp</a>, <a class="el" href="_convertible_bonds_8cpp-example.html#_a18">ConvertibleBonds.cpp</a>, <a class="el" href="_c_v_a_i_r_s_8cpp-example.html#_a19">CVAIRS.cpp</a>, <a class="el" href="_discrete_hedging_8cpp-example.html#_a16">DiscreteHedging.cpp</a>, <a class="el" href="_equity_option_8cpp-example.html#_a9">EquityOption.cpp</a>, <a class="el" href="_fitted_bond_curve_8cpp-example.html#_a2">FittedBondCurve.cpp</a>, <a class="el" href="_f_r_a_8cpp-example.html#_a10">FRA.cpp</a>, <a class="el" href="_multicurve_bootstrapping_8cpp-example.html#_a9">MulticurveBootstrapping.cpp</a>, <a class="el" href="_replication_8cpp-example.html#_a5">Replication.cpp</a>, and <a class="el" href="_repo_8cpp-example.html#_a2">Repo.cpp</a>.</dd>
</dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="aaa4f1efef860b6bb4fcd980868483229"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa4f1efef860b6bb4fcd980868483229">&#9670;&nbsp;</a></span>DayCounter() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> </td>
          <td>(</td>
          <td class="paramtype">const ext::shared_ptr&lt; <a class="el" href="class_quant_lib_1_1_day_counter_1_1_impl.html">Impl</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>impl</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This constructor can be invoked by derived classes which define a given implementation. </p>

</div>
</div>
<a id="a4c13117cd5659354dad5d3a3d4b36925"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c13117cd5659354dad5d3a3d4b36925">&#9670;&nbsp;</a></span>DayCounter() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The default constructor returns a day counter with a null implementation, which is therefore unusable except as a placeholder. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a1d89c28bd42ba9a52da008bb69367171"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d89c28bd42ba9a52da008bb69367171">&#9670;&nbsp;</a></span>name()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string name </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the name of the day counter. </p>
<dl class="caveats"><dt><b><a class="el" href="caveats.html#_caveats000188">Warning:</a></b></dt><dd>This method is used for output and comparison between day counters. It is <b>not</b> meant to be used for writing switch-on-type code. </dd></dl>

</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="acbca520b46832e1a53e72053c233692c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acbca520b46832e1a53e72053c233692c">&#9670;&nbsp;</a></span>operator==()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &amp;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns <code>true</code> iff the two day counters belong to the same derived class. </p>

</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="http://www.doxygen.org/index.html">Doxygen</a>
1.8.20
</small></address>
</body>
</html>