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
|
<!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>CommodityIndex 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_commodity_index.html">CommodityIndex</a> </li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pro-attribs">Protected Attributes</a> |
<a href="#friends">Friends</a> </div>
<div class="headertitle">
<div class="title">CommodityIndex Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="QuantLib::CommodityIndex" --><!-- doxytag: inherits="QuantLib::Observable,QuantLib::Observer" -->
<p>base class for commodity indexes
<a href="class_quant_lib_1_1_commodity_index.html#details">More...</a></p>
<p><code>#include <ql/experimental/commodities/commodityindex.hpp></code></p>
<div class="dynheader">
Inheritance diagram for CommodityIndex:</div>
<div class="dyncontent">
<div class="center"><img src="class_quant_lib_1_1_commodity_index__inherit__graph.png" border="0" usemap="#_commodity_index_inherit__map" alt="Inheritance graph"/></div>
<map name="_commodity_index_inherit__map" id="_commodity_index_inherit__map">
<area shape="rect" id="node2" href="class_quant_lib_1_1_observable.html" title="Object that notifies its changes to a set of observers." alt="" coords="5,6,93,37"/><area shape="rect" id="node4" href="class_quant_lib_1_1_observer.html" title="Object that gets notified when a given observable changes." alt="" coords="117,6,192,37"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="class_quant_lib_1_1_commodity_index-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a74f35eb3d78b2859e3f101bb8fca6492"></a><!-- doxytag: member="QuantLib::CommodityIndex::CommodityIndex" ref="a74f35eb3d78b2859e3f101bb8fca6492" args="(const std::string &name, const CommodityType &commodityType, const Currency &currency, const UnitOfMeasure &unitOfMeasure, const Calendar &calendar, Real lotQuantity, const boost::shared_ptr< CommodityCurve > &forwardCurve, const boost::shared_ptr< ExchangeContracts > &exchangeContracts, int nearbyOffset)" -->
 </td><td class="memItemRight" valign="bottom"><b>CommodityIndex</b> (const std::string &name, const <a class="el" href="class_quant_lib_1_1_commodity_type.html">CommodityType</a> &commodityType, const <a class="el" href="class_quant_lib_1_1_currency.html">Currency</a> &currency, const <a class="el" href="class_quant_lib_1_1_unit_of_measure.html">UnitOfMeasure</a> &unitOfMeasure, const <a class="el" href="class_quant_lib_1_1_calendar.html">Calendar</a> &calendar, <a class="el" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> lotQuantity, const boost::shared_ptr< <a class="el" href="class_quant_lib_1_1_commodity_curve.html">CommodityCurve</a> > &forwardCurve, const boost::shared_ptr< ExchangeContracts > &exchangeContracts, int nearbyOffset)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6e7c2f06156bc986266ded7619af86ac"></a><!-- doxytag: member="QuantLib::CommodityIndex::addQuote" ref="a6e7c2f06156bc986266ded7619af86ac" args="(const Date &quoteDate, Real quote)" -->
void </td><td class="memItemRight" valign="bottom"><b>addQuote</b> (const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &quoteDate, <a class="el" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> quote)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad224c1a7c70301d545c2d63ece164d8b"></a><!-- doxytag: member="QuantLib::CommodityIndex::addQuotes" ref="ad224c1a7c70301d545c2d63ece164d8b" args="(const std::map< Date, Real > &quotes)" -->
void </td><td class="memItemRight" valign="bottom"><b>addQuotes</b> (const std::map< <a class="el" href="class_quant_lib_1_1_date.html">Date</a>, <a class="el" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> > &quotes)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a47256ff46c55a4a73152af3b83350ddf"></a><!-- doxytag: member="QuantLib::CommodityIndex::clearQuotes" ref="a47256ff46c55a4a73152af3b83350ddf" args="()" -->
void </td><td class="memItemRight" valign="bottom"><b>clearQuotes</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7d2fba75b27aca061c42efea5b80f7fc"></a><!-- doxytag: member="QuantLib::CommodityIndex::isValidQuoteDate" ref="a7d2fba75b27aca061c42efea5b80f7fc" args="(const Date &quoteDate) const " -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_commodity_index.html#a7d2fba75b27aca061c42efea5b80f7fc">isValidQuoteDate</a> (const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &quoteDate) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">returns TRUE if the quote date is valid <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac6e61de369e994009e36f344f99c15ad"></a><!-- doxytag: member="QuantLib::CommodityIndex::empty" ref="ac6e61de369e994009e36f344f99c15ad" args="() const " -->
bool </td><td class="memItemRight" valign="bottom"><b>empty</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a28a48365ab4d6d488ed5d2ce442fe524"></a><!-- doxytag: member="QuantLib::CommodityIndex::forwardCurveEmpty" ref="a28a48365ab4d6d488ed5d2ce442fe524" args="() const " -->
bool </td><td class="memItemRight" valign="bottom"><b>forwardCurveEmpty</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a45a42a373bc45cab8cb46d7d4f079b38"></a><!-- doxytag: member="QuantLib::CommodityIndex::quotes" ref="a45a42a373bc45cab8cb46d7d4f079b38" args="() const " -->
const <a class="el" href="class_quant_lib_1_1_time_series.html">TimeSeries</a>< <a class="el" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> > & </td><td class="memItemRight" valign="bottom"><b>quotes</b> () const </td></tr>
<tr><td colspan="2"><div class="groupHeader">Index interface</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a37627d5d5bba7f4a8690c71c2ab3cb07"></a><!-- doxytag: member="QuantLib::CommodityIndex::name" ref="a37627d5d5bba7f4a8690c71c2ab3cb07" args="() const " -->
std::string </td><td class="memItemRight" valign="bottom"><b>name</b> () const </td></tr>
<tr><td colspan="2"><div class="groupHeader">Observer interface</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_commodity_index.html#ac5c54df7ed3b930268c8d7752c101725">update</a> ()</td></tr>
<tr><td colspan="2"><div class="groupHeader">Inspectors</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a37755c700c75d5810577a5dfbd10446a"></a><!-- doxytag: member="QuantLib::CommodityIndex::commodityType" ref="a37755c700c75d5810577a5dfbd10446a" args="() const " -->
const <a class="el" href="class_quant_lib_1_1_commodity_type.html">CommodityType</a> & </td><td class="memItemRight" valign="bottom"><b>commodityType</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae1a84781300fdb3e7b7f3b719fda0610"></a><!-- doxytag: member="QuantLib::CommodityIndex::currency" ref="ae1a84781300fdb3e7b7f3b719fda0610" args="() const " -->
const <a class="el" href="class_quant_lib_1_1_currency.html">Currency</a> & </td><td class="memItemRight" valign="bottom"><b>currency</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a04ebdb0779a676fed38122c80f7190e6"></a><!-- doxytag: member="QuantLib::CommodityIndex::unitOfMeasure" ref="a04ebdb0779a676fed38122c80f7190e6" args="() const " -->
const <a class="el" href="class_quant_lib_1_1_unit_of_measure.html">UnitOfMeasure</a> & </td><td class="memItemRight" valign="bottom"><b>unitOfMeasure</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1dfea729100daaf17a5ac3b724c02556"></a><!-- doxytag: member="QuantLib::CommodityIndex::calendar" ref="a1dfea729100daaf17a5ac3b724c02556" args="() const " -->
const <a class="el" href="class_quant_lib_1_1_calendar.html">Calendar</a> & </td><td class="memItemRight" valign="bottom"><b>calendar</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1f34ae89e89dbd1e8b6b819fab67d876"></a><!-- doxytag: member="QuantLib::CommodityIndex::forwardCurve" ref="a1f34ae89e89dbd1e8b6b819fab67d876" args="() const " -->
const boost::shared_ptr<br class="typebreak"/>
< <a class="el" href="class_quant_lib_1_1_commodity_curve.html">CommodityCurve</a> > & </td><td class="memItemRight" valign="bottom"><b>forwardCurve</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a49ef143f1d484eafaa99baa3c7ea9b09"></a><!-- doxytag: member="QuantLib::CommodityIndex::lotQuantity" ref="a49ef143f1d484eafaa99baa3c7ea9b09" args="() const " -->
<a class="el" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> </td><td class="memItemRight" valign="bottom"><b>lotQuantity</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac495fd9bc1177fa5ff37da1dd4382f13"></a><!-- doxytag: member="QuantLib::CommodityIndex::price" ref="ac495fd9bc1177fa5ff37da1dd4382f13" args="(const Date &date)" -->
<a class="el" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> </td><td class="memItemRight" valign="bottom"><b>price</b> (const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &date)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ada34e3301903ed5c0e42cc0dc0bdf770"></a><!-- doxytag: member="QuantLib::CommodityIndex::forwardPrice" ref="ada34e3301903ed5c0e42cc0dc0bdf770" args="(const Date &date) const " -->
<a class="el" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> </td><td class="memItemRight" valign="bottom"><b>forwardPrice</b> (const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &date) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac2415a2511bd3784612e1b83ed7ed876"></a><!-- doxytag: member="QuantLib::CommodityIndex::lastQuoteDate" ref="ac2415a2511bd3784612e1b83ed7ed876" args="() const " -->
<a class="el" href="class_quant_lib_1_1_date.html">Date</a> </td><td class="memItemRight" valign="bottom"><b>lastQuoteDate</b> () const </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="a4d739cc5d335052eb9f5b2ca559b81d1"></a><!-- doxytag: member="QuantLib::CommodityIndex::name_" ref="a4d739cc5d335052eb9f5b2ca559b81d1" args="" -->
std::string </td><td class="memItemRight" valign="bottom"><b>name_</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a792de4e88e29e3df5d753c1590d47d8c"></a><!-- doxytag: member="QuantLib::CommodityIndex::commodityType_" ref="a792de4e88e29e3df5d753c1590d47d8c" args="" -->
<a class="el" href="class_quant_lib_1_1_commodity_type.html">CommodityType</a> </td><td class="memItemRight" valign="bottom"><b>commodityType_</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a14f8e29ce8fa87acbbc6b40f2e0dda26"></a><!-- doxytag: member="QuantLib::CommodityIndex::unitOfMeasure_" ref="a14f8e29ce8fa87acbbc6b40f2e0dda26" args="" -->
<a class="el" href="class_quant_lib_1_1_unit_of_measure.html">UnitOfMeasure</a> </td><td class="memItemRight" valign="bottom"><b>unitOfMeasure_</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9b8209f252ea1344d7fa6de58bc1102a"></a><!-- doxytag: member="QuantLib::CommodityIndex::currency_" ref="a9b8209f252ea1344d7fa6de58bc1102a" args="" -->
<a class="el" href="class_quant_lib_1_1_currency.html">Currency</a> </td><td class="memItemRight" valign="bottom"><b>currency_</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a021eab7f1f44c1c71b8dfd29b9c4864b"></a><!-- doxytag: member="QuantLib::CommodityIndex::calendar_" ref="a021eab7f1f44c1c71b8dfd29b9c4864b" args="" -->
<a class="el" href="class_quant_lib_1_1_calendar.html">Calendar</a> </td><td class="memItemRight" valign="bottom"><b>calendar_</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a962c0c33ed0ad6d0d7e48570b8046a65"></a><!-- doxytag: member="QuantLib::CommodityIndex::lotQuantity_" ref="a962c0c33ed0ad6d0d7e48570b8046a65" args="" -->
<a class="el" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> </td><td class="memItemRight" valign="bottom"><b>lotQuantity_</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad4e664d53d5808c33e427a321783ab23"></a><!-- doxytag: member="QuantLib::CommodityIndex::quotes_" ref="ad4e664d53d5808c33e427a321783ab23" args="" -->
<a class="el" href="class_quant_lib_1_1_time_series.html">TimeSeries</a>< <a class="el" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> > </td><td class="memItemRight" valign="bottom"><b>quotes_</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a986e3b25dff8b0df2b48abc9727fd2b6"></a><!-- doxytag: member="QuantLib::CommodityIndex::forwardCurve_" ref="a986e3b25dff8b0df2b48abc9727fd2b6" args="" -->
boost::shared_ptr< <a class="el" href="class_quant_lib_1_1_commodity_curve.html">CommodityCurve</a> > </td><td class="memItemRight" valign="bottom"><b>forwardCurve_</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4ffbdd4b61bb31eaac436070f90a08bd"></a><!-- doxytag: member="QuantLib::CommodityIndex::forwardCurveUomConversionFactor_" ref="a4ffbdd4b61bb31eaac436070f90a08bd" args="" -->
<a class="el" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> </td><td class="memItemRight" valign="bottom"><b>forwardCurveUomConversionFactor_</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9171225274785575d36966c673ed3750"></a><!-- doxytag: member="QuantLib::CommodityIndex::exchangeContracts_" ref="a9171225274785575d36966c673ed3750" args="" -->
boost::shared_ptr<br class="typebreak"/>
< ExchangeContracts > </td><td class="memItemRight" valign="bottom"><b>exchangeContracts_</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af2a01ec45b97c52196a81afb1ed6b2b5"></a><!-- doxytag: member="QuantLib::CommodityIndex::nearbyOffset_" ref="af2a01ec45b97c52196a81afb1ed6b2b5" args="" -->
<a class="el" href="group__types.html#gab9c87440c314438e51a899a03d2442d0">Integer</a> </td><td class="memItemRight" valign="bottom"><b>nearbyOffset_</b></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8c7b1849a56109c524929e46b0132c0c"></a><!-- doxytag: member="QuantLib::CommodityIndex::operator<<" ref="a8c7b1849a56109c524929e46b0132c0c" args="(std::ostream &, const CommodityIndex &)" -->
std::ostream & </td><td class="memItemRight" valign="bottom"><b>operator<<</b> (std::ostream &, const <a class="el" href="class_quant_lib_1_1_commodity_index.html">CommodityIndex</a> &)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>base class for commodity indexes </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac5c54df7ed3b930268c8d7752c101725"></a><!-- doxytag: member="QuantLib::CommodityIndex::update" ref="ac5c54df7ed3b930268c8d7752c101725" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_quant_lib_1_1_commodity_index.html#ac5c54df7ed3b930268c8d7752c101725">update</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes. </p>
<p>Implements <a class="el" href="class_quant_lib_1_1_observer.html#a99b02345a8a15d3c5ea2844a2253f510">Observer</a>.</p>
</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>
|