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 287 288
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="robots" content="none">
<title>DayCounter Class Reference</title>
<link rel="stylesheet" href="quantlib.css" type="text/css">
<link rel="stylesheet" href="print.css" type="text/css" media="print">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div id="container">
<div id="header">
<img class="titleimage"
src="QL-title.jpg" width="185" height="50" border="0"
alt="QuantLib">
<br>
<h3 class="subtitle">A free/open-source library for quantitative finance</h3>
</div>
<div id="menu">
<h3 class="navbartitle">Version 1.2</h3>
<hr>
<h3 class="navbartitle">Getting started</h3>
<ul class="navbarlist">
<li class="navlink"><a href="index.html">Introduction</a></li>
<li class="navlink"><a href="where.html">Where to get QuantLib</a></li>
<li class="navlink"><a href="install.html">Installation</a></li>
<li class="navlink"><a href="config.html">Configuration</a></li>
<li class="navlink"><a href="usage.html">Usage</a></li>
<li class="navlink"><a href="history.html">Version history</a></li>
<li class="navlink"><a href="resources.html">Additional resources</a></li>
<li class="navlink"><a href="group.html">The QuantLib group</a></li>
<li class="navlink"><a href="license.html">Copyright and license</a></li>
</ul>
<hr>
<h3 class="navbartitle">Reference manual</h3>
<ul class="navbarlist">
<li class="navlink"><a href="modules.html">Modules</a></li>
<li class="navlink"><a href="hierarchy.html">Class Hierarchy</a></li>
<li class="navlink"><a href="annotated.html">Compound List</a></li>
<li class="navlink"><a href="files.html">File List</a></li>
<li class="navlink"><a href="functions.html">Compound Members</a></li>
<li class="navlink"><a href="globals.html">File Members</a></li>
<li class="navlink"><a href="todo.html">Todo List</a></li>
<li class="navlink"><a href="bug.html">Known Bugs</a></li>
<li class="navlink"><a href="caveats.html">Caveats</a></li>
<li class="navlink"><a href="test.html">Test Suite</a></li>
<li class="navlink"><a href="examples.html">Examples</a></li>
</ul>
</div>
<div id="content">
<!--Doxygen-generated content-->
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>QuantLib</b> </li>
<li class="navelem"><a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> </li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pro-methods">Protected Member Functions</a> |
<a href="#pro-attribs">Protected Attributes</a> |
<a href="#related">Related Functions</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">
<!-- doxytag: class="QuantLib::DayCounter" -->
<p>day counter class
<a href="class_quant_lib_1_1_day_counter.html#details">More...</a></p>
<p><code>#include <ql/time/daycounter.hpp></code></p>
<div class="dynheader">
Inheritance diagram for DayCounter:</div>
<div class="dyncontent">
<div class="center"><img src="class_quant_lib_1_1_day_counter__inherit__graph.png" border="0" usemap="#_day_counter_inherit__map" alt="Inheritance graph"/></div>
<map name="_day_counter_inherit__map" id="_day_counter_inherit__map">
<area shape="rect" id="node3" href="class_quant_lib_1_1_actual360.html" title="Actual/360 day count convention." alt="" coords="169,5,249,35"/><area shape="rect" id="node5" href="class_quant_lib_1_1_actual365_fixed.html" title="Actual/365 (Fixed) day count convention." alt="" coords="153,58,265,89"/><area shape="rect" id="node7" href="class_quant_lib_1_1_actual_actual.html" title="Actual/Actual day count." alt="" coords="161,111,257,142"/><area shape="rect" id="node9" href="class_quant_lib_1_1_business252.html" title="Business/252 day count convention." alt="" coords="161,165,257,195"/><area shape="rect" id="node11" href="class_quant_lib_1_1_one_day_counter.html" title="1/1 day count convention" alt="" coords="152,218,267,249"/><area shape="rect" id="node13" href="class_quant_lib_1_1_simple_day_counter.html" title="Simple day counter for reproducing theoretical calculations." alt="" coords="144,271,275,302"/><area shape="rect" id="node15" href="class_quant_lib_1_1_thirty360.html" title="30/360 day count convention" alt="" coords="172,325,247,355"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="class_quant_lib_1_1_day_counter-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class  </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><td class="mdescLeft"> </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><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a4c13117cd5659354dad5d3a3d4b36925">DayCounter</a> ()</td></tr>
<tr><td colspan="2"><div class="groupHeader">DayCounter interface</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac6e61de369e994009e36f344f99c15ad"></a><!-- doxytag: member="QuantLib::DayCounter::empty" ref="ac6e61de369e994009e36f344f99c15ad" args="() const " -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#ac6e61de369e994009e36f344f99c15ad">empty</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns whether or not the day counter is initialized. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a37627d5d5bba7f4a8690c71c2ab3cb07">name</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the name of the day counter. <a href="#a37627d5d5bba7f4a8690c71c2ab3cb07"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a339ef693d51f8a2ec0e59c90986dddec"></a><!-- doxytag: member="QuantLib::DayCounter::dayCount" ref="a339ef693d51f8a2ec0e59c90986dddec" args="(const Date &, const Date &) const " -->
<a class="el" href="group__types.html#ga4f0ecbbf99e41b6d69cd54871d5d2b9e">BigInteger</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a339ef693d51f8a2ec0e59c90986dddec">dayCount</a> (const <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> &) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of days between two dates. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af45d6af610c92c3fa975077f081002e6"></a><!-- doxytag: member="QuantLib::DayCounter::yearFraction" ref="af45d6af610c92c3fa975077f081002e6" args="(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const " -->
<a class="el" href="group__types.html#ga14fb8fca43a68f4168654e1f9f7e22f7">Time</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#af45d6af610c92c3fa975077f081002e6">yearFraction</a> (const <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> &, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &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> &refPeriodEnd=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>()) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the period between two dates as a fraction of year. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a6f11ec688642d2b1aa3fc401ff4459e5">DayCounter</a> (const boost::shared_ptr< <a class="el" href="class_quant_lib_1_1_day_counter_1_1_impl.html">Impl</a> > &impl)</td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa593fa134416a954928e323a5175af7d"></a><!-- doxytag: member="QuantLib::DayCounter::impl_" ref="aa593fa134416a954928e323a5175af7d" args="" -->
boost::shared_ptr< <a class="el" href="class_quant_lib_1_1_day_counter_1_1_impl.html">Impl</a> > </td><td class="memItemRight" valign="bottom"><b>impl_</b></td></tr>
<tr><td colspan="2"><h2><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><td class="memItemLeft" align="right" valign="top">bool </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> &, const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a0f7511e2a309e1588a2f300def9b495c">operator!=</a> (const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &, const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::ostream & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_day_counter.html#a68dd78dd1968d9b0c1d0702a6f3be500">operator<<</a> (std::ostream &, const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>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><dt><b>Examples: </b></dt><dd><a class="el" href="_bermudan_swaption_8cpp-example.html#_a19">BermudanSwaption.cpp</a>, <a class="el" href="_bonds_8cpp-example.html#_a12">Bonds.cpp</a>, <a class="el" href="_callable_bonds_8cpp-example.html#_a2">CallableBonds.cpp</a>, <a class="el" href="_convertible_bonds_8cpp-example.html#_a19">ConvertibleBonds.cpp</a>, <a class="el" href="_discrete_hedging_8cpp-example.html#_a18">DiscreteHedging.cpp</a>, <a class="el" href="_equity_option_8cpp-example.html#_a11">EquityOption.cpp</a>, <a class="el" href="_fitted_bond_curve_8cpp-example.html#_a3">FittedBondCurve.cpp</a>, <a class="el" href="_f_r_a_8cpp-example.html#_a11">FRA.cpp</a>, <a class="el" href="_replication_8cpp-example.html#_a7">Replication.cpp</a>, <a class="el" href="_repo_8cpp-example.html#_a3">Repo.cpp</a>, and <a class="el" href="swapvaluation_8cpp-example.html#_a12">swapvaluation.cpp</a>.</dd>
</dl></div><hr/><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="a6f11ec688642d2b1aa3fc401ff4459e5"></a><!-- doxytag: member="QuantLib::DayCounter::DayCounter" ref="a6f11ec688642d2b1aa3fc401ff4459e5" args="(const boost::shared_ptr< Impl > &impl)" -->
<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="paramtype">const boost::shared_ptr< <a class="el" href="class_quant_lib_1_1_day_counter_1_1_impl.html">Impl</a> > & </td>
<td class="paramname"><em>impl</em></td><td>)</td>
<td><code> [protected]</code></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 class="anchor" id="a4c13117cd5659354dad5d3a3d4b36925"></a><!-- doxytag: member="QuantLib::DayCounter::DayCounter" ref="a4c13117cd5659354dad5d3a3d4b36925" args="()" -->
<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>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a37627d5d5bba7f4a8690c71c2ab3cb07"></a><!-- doxytag: member="QuantLib::DayCounter::name" ref="a37627d5d5bba7f4a8690c71c2ab3cb07" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string <a class="el" href="class_quant_lib_1_1_day_counter.html#a37627d5d5bba7f4a8690c71c2ab3cb07">name</a> </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#_caveats000144">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>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="acbca520b46832e1a53e72053c233692c"></a><!-- doxytag: member="QuantLib::DayCounter::operator==" ref="acbca520b46832e1a53e72053c233692c" args="(const DayCounter &, const DayCounter &)" -->
<div class="memitem">
<div class="memproto">
<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> & </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> & </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [related]</code></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>
<a class="anchor" id="a0f7511e2a309e1588a2f300def9b495c"></a><!-- doxytag: member="QuantLib::DayCounter::operator!=" ref="a0f7511e2a309e1588a2f300def9b495c" args="(const DayCounter &, const DayCounter &)" -->
<div class="memitem">
<div class="memproto">
<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> & </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> & </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [related]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a68dd78dd1968d9b0c1d0702a6f3be500"></a><!-- doxytag: member="QuantLib::DayCounter::operator<<" ref="a68dd78dd1968d9b0c1d0702a6f3be500" args="(std::ostream &, const DayCounter &)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::ostream & operator<< </td>
<td>(</td>
<td class="paramtype">std::ostream & </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> & </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [related]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
</div><!-- contents -->
</div>
<div class="footer">
<div class="endmatter">
Documentation generated by
<a href="http://www.doxygen.org">Doxygen</a> 1.7.6.1
</div>
</div>
</div>
</body>
</html>
|