File: class_quant_lib_1_1_cash_flows.html

package info (click to toggle)
quantlib-refman-html 0.9.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 60,592 kB
  • ctags: 7,595
  • sloc: makefile: 30
file content (527 lines) | stat: -rw-r--r-- 33,352 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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
<!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>QuantLib: CashFlows 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="212" height="47" 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 0.9.0</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="overview.html">Project overview</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="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.5.4 -->
<div class="nav">
<a class="el" href="namespace_quant_lib.html">QuantLib</a>::<a class="el" href="class_quant_lib_1_1_cash_flows.html">CashFlows</a></div>
<h1>CashFlows Class Reference</h1><!-- doxytag: class="QuantLib::CashFlows" --><code>#include &lt;ql/cashflows/cashflows.hpp&gt;</code>
<p>

<p>
<a href="class_quant_lib_1_1_cash_flows-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
cashflow-analysis functions 
<p>
<dl compact><dt><b><a class="el" href="todo.html#_todo000001">Possible enhancements:</a></b></dt><dd>add tests </dd></dl>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8975c483ba39ff589620a367085983bf"></a><!-- doxytag: member="QuantLib::CashFlows::lastCashFlow" ref="8975c483ba39ff589620a367085983bf" args="(const Leg &amp;leg, const Date &amp;refDate=Date())" -->
static Leg::const_iterator&nbsp;</td><td class="memItemRight" valign="bottom"><b>lastCashFlow</b> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;refDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>())</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3a7a8e1a129a79fb2dc87e2cc1d020db"></a><!-- doxytag: member="QuantLib::CashFlows::nextCashFlow" ref="3a7a8e1a129a79fb2dc87e2cc1d020db" args="(const Leg &amp;leg, const Date &amp;refDate=Date())" -->
static Leg::const_iterator&nbsp;</td><td class="memItemRight" valign="bottom"><b>nextCashFlow</b> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;refDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>())</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2b98e6c83439578487f560276beef816"></a><!-- doxytag: member="QuantLib::CashFlows::previousCouponRate" ref="2b98e6c83439578487f560276beef816" args="(const Leg &amp;leg, const Date &amp;refDate=Date())" -->
static <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>previousCouponRate</b> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;refDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>())</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="289d54573fdc6ff50414793adf309f57"></a><!-- doxytag: member="QuantLib::CashFlows::currentCouponRate" ref="289d54573fdc6ff50414793adf309f57" args="(const Leg &amp;leg, const Date &amp;refDate=Date())" -->
static <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>currentCouponRate</b> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;refDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>())</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3393c4e4a7533490b540d49466594f24"></a><!-- doxytag: member="QuantLib::CashFlows::startDate" ref="3393c4e4a7533490b540d49466594f24" args="(const Leg &amp;leg)" -->
static <a class="el" href="class_quant_lib_1_1_date.html">Date</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>startDate</b> (const Leg &amp;leg)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="356f8aea0022acb2e628dfce5cf47e14"></a><!-- doxytag: member="QuantLib::CashFlows::maturityDate" ref="356f8aea0022acb2e628dfce5cf47e14" args="(const Leg &amp;leg)" -->
static <a class="el" href="class_quant_lib_1_1_date.html">Date</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>maturityDate</b> (const Leg &amp;leg)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cash_flows.html#7d4ca7e15521300dbf03cd2e0b7a4a7e">npv</a> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_yield_term_structure.html">YieldTermStructure</a> &amp;discountCurve, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;settlementDate=<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;npvDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>(), <a class="el" href="group__types.html#gb9c87440c314438e51a899a03d2442d0">Integer</a> exDividendDays=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">NPV of the cash flows.  <a href="#7d4ca7e15521300dbf03cd2e0b7a4a7e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cash_flows.html#412d5eacc153f1b903b93f35822cd117">npv</a> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_interest_rate.html">InterestRate</a> &amp;, <a class="el" href="class_quant_lib_1_1_date.html">Date</a> settlementDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>())</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">NPV of the cash flows.  <a href="#412d5eacc153f1b903b93f35822cd117"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cash_flows.html#59f2d4d8324f3880e98c31a6e44a9066">bps</a> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_yield_term_structure.html">YieldTermStructure</a> &amp;discountCurve, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;settlementDate=<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;npvDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>(), <a class="el" href="group__types.html#gb9c87440c314438e51a899a03d2442d0">Integer</a> exDividendDays=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Basis-point sensitivity of the cash flows.  <a href="#59f2d4d8324f3880e98c31a6e44a9066"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cash_flows.html#e068a58f23eb3c0fcb83adc23bfd6aae">bps</a> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_interest_rate.html">InterestRate</a> &amp;, <a class="el" href="class_quant_lib_1_1_date.html">Date</a> settlementDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>())</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Basis-point sensitivity of the cash flows.  <a href="#e068a58f23eb3c0fcb83adc23bfd6aae"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cash_flows.html#529815c8ace1d3f9885ecb789448ed39">atmRate</a> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_yield_term_structure.html">YieldTermStructure</a> &amp;discountCurve, const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;settlementDate=<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;npvDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>(), <a class="el" href="group__types.html#gb9c87440c314438e51a899a03d2442d0">Integer</a> exDividendDays=0, <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> npv=<a class="el" href="class_quant_lib_1_1_null.html">Null</a>&lt; <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> &gt;())</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">At-the-money rate of the cash flows.  <a href="#529815c8ace1d3f9885ecb789448ed39"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cash_flows.html#183195eb869dea81a239278b40a94eac">irr</a> (const Leg &amp;leg, <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> marketPrice, const <a class="el" href="class_quant_lib_1_1_day_counter.html">DayCounter</a> &amp;dayCounter, <a class="el" href="namespace_quant_lib.html#2779d04b4839fd386b5c85bbb96aaf73">Compounding</a> compounding, <a class="el" href="group__datetime.html#g6d41db8ba0ea90d22df35889df452ada">Frequency</a> frequency=NoFrequency, <a class="el" href="class_quant_lib_1_1_date.html">Date</a> settlementDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>(), <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> tolerance=1.0e-10, Size maxIterations=10000, Rate guess=0.05)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Internal rate of return.  <a href="#183195eb869dea81a239278b40a94eac"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="group__types.html#g14fb8fca43a68f4168654e1f9f7e22f7">Time</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cash_flows.html#e40ebdc4a70ff54f7eb55b4457a332e2">duration</a> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_interest_rate.html">InterestRate</a> &amp;y, Duration::Type type=Duration::Modified, <a class="el" href="class_quant_lib_1_1_date.html">Date</a> settlementDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>())</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Cash-flow duration.  <a href="#e40ebdc4a70ff54f7eb55b4457a332e2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_cash_flows.html#4b45567c608fe19776209fd039c1b7fc">convexity</a> (const Leg &amp;leg, const <a class="el" href="class_quant_lib_1_1_interest_rate.html">InterestRate</a> &amp;y, <a class="el" href="class_quant_lib_1_1_date.html">Date</a> settlementDate=<a class="el" href="class_quant_lib_1_1_date.html">Date</a>())</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Cash-flow convexity.  <a href="#4b45567c608fe19776209fd039c1b7fc"></a><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="7d4ca7e15521300dbf03cd2e0b7a4a7e"></a><!-- doxytag: member="QuantLib::CashFlows::npv" ref="7d4ca7e15521300dbf03cd2e0b7a4a7e" args="(const Leg &amp;leg, const YieldTermStructure &amp;discountCurve, const Date &amp;settlementDate=Date(), const Date &amp;npvDate=Date(), Integer exDividendDays=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> npv           </td>
          <td>(</td>
          <td class="paramtype">const Leg &amp;&nbsp;</td>
          <td class="paramname"> <em>leg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_yield_term_structure.html">YieldTermStructure</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>discountCurve</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>settlementDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>npvDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gb9c87440c314438e51a899a03d2442d0">Integer</a>&nbsp;</td>
          <td class="paramname"> <em>exDividendDays</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
NPV of the cash flows. 
<p>
The NPV is the sum of the cash flows, each discounted according to the given term structure. 
</div>
</div><p>
<a class="anchor" name="412d5eacc153f1b903b93f35822cd117"></a><!-- doxytag: member="QuantLib::CashFlows::npv" ref="412d5eacc153f1b903b93f35822cd117" args="(const Leg &amp;leg, const InterestRate &amp;, Date settlementDate=Date())" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> npv           </td>
          <td>(</td>
          <td class="paramtype">const Leg &amp;&nbsp;</td>
          <td class="paramname"> <em>leg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_interest_rate.html">InterestRate</a> &amp;&nbsp;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_quant_lib_1_1_date.html">Date</a>&nbsp;</td>
          <td class="paramname"> <em>settlementDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
NPV of the cash flows. 
<p>
The NPV is the sum of the cash flows, each discounted according to the given constant interest rate. The result is affected by the choice of the interest-rate compounding and the relative frequency and day counter. 
</div>
</div><p>
<a class="anchor" name="59f2d4d8324f3880e98c31a6e44a9066"></a><!-- doxytag: member="QuantLib::CashFlows::bps" ref="59f2d4d8324f3880e98c31a6e44a9066" args="(const Leg &amp;leg, const YieldTermStructure &amp;discountCurve, const Date &amp;settlementDate=Date(), const Date &amp;npvDate=Date(), Integer exDividendDays=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> bps           </td>
          <td>(</td>
          <td class="paramtype">const Leg &amp;&nbsp;</td>
          <td class="paramname"> <em>leg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_yield_term_structure.html">YieldTermStructure</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>discountCurve</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>settlementDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>npvDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gb9c87440c314438e51a899a03d2442d0">Integer</a>&nbsp;</td>
          <td class="paramname"> <em>exDividendDays</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Basis-point sensitivity of the cash flows. 
<p>
The result is the change in NPV due to a uniform 1-basis-point change in the rate paid by the cash flows. The change for each coupon is discounted according to the given term structure. 
</div>
</div><p>
<a class="anchor" name="e068a58f23eb3c0fcb83adc23bfd6aae"></a><!-- doxytag: member="QuantLib::CashFlows::bps" ref="e068a58f23eb3c0fcb83adc23bfd6aae" args="(const Leg &amp;leg, const InterestRate &amp;, Date settlementDate=Date())" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> bps           </td>
          <td>(</td>
          <td class="paramtype">const Leg &amp;&nbsp;</td>
          <td class="paramname"> <em>leg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_interest_rate.html">InterestRate</a> &amp;&nbsp;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_quant_lib_1_1_date.html">Date</a>&nbsp;</td>
          <td class="paramname"> <em>settlementDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Basis-point sensitivity of the cash flows. 
<p>
The result is the change in NPV due to a uniform 1-basis-point change in the rate paid by the cash flows. The change for each coupon is discounted according to the given constant interest rate. The result is affected by the choice of the interest-rate compounding and the relative frequency and day counter. 
</div>
</div><p>
<a class="anchor" name="529815c8ace1d3f9885ecb789448ed39"></a><!-- doxytag: member="QuantLib::CashFlows::atmRate" ref="529815c8ace1d3f9885ecb789448ed39" args="(const Leg &amp;leg, const YieldTermStructure &amp;discountCurve, const Date &amp;settlementDate=Date(), const Date &amp;npvDate=Date(), Integer exDividendDays=0, Real npv=Null&lt; Real &gt;())" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a> atmRate           </td>
          <td>(</td>
          <td class="paramtype">const Leg &amp;&nbsp;</td>
          <td class="paramname"> <em>leg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_yield_term_structure.html">YieldTermStructure</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>discountCurve</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>settlementDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_date.html">Date</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>npvDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gb9c87440c314438e51a899a03d2442d0">Integer</a>&nbsp;</td>
          <td class="paramname"> <em>exDividendDays</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a>&nbsp;</td>
          <td class="paramname"> <em>npv</em> = <code><a class="el" href="class_quant_lib_1_1_null.html">Null</a>&lt;&nbsp;<a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a>&nbsp;&gt;()</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
At-the-money rate of the cash flows. 
<p>
The result is the fixed rate for which a fixed rate cash flow vector, equivalent to the input vector, has the required NPV according to the given term structure. If the required NPV is not given, the input cash flow vector's NPV is used instead. 
</div>
</div><p>
<a class="anchor" name="183195eb869dea81a239278b40a94eac"></a><!-- doxytag: member="QuantLib::CashFlows::irr" ref="183195eb869dea81a239278b40a94eac" args="(const Leg &amp;leg, Real marketPrice, const DayCounter &amp;dayCounter, Compounding compounding, Frequency frequency=NoFrequency, Date settlementDate=Date(), Real tolerance=1.0e-10, Size maxIterations=10000, Rate guess=0.05)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a> irr           </td>
          <td>(</td>
          <td class="paramtype">const Leg &amp;&nbsp;</td>
          <td class="paramname"> <em>leg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a>&nbsp;</td>
          <td class="paramname"> <em>marketPrice</em>, </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;&nbsp;</td>
          <td class="paramname"> <em>dayCounter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespace_quant_lib.html#2779d04b4839fd386b5c85bbb96aaf73">Compounding</a>&nbsp;</td>
          <td class="paramname"> <em>compounding</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__datetime.html#g6d41db8ba0ea90d22df35889df452ada">Frequency</a>&nbsp;</td>
          <td class="paramname"> <em>frequency</em> = <code>NoFrequency</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_quant_lib_1_1_date.html">Date</a>&nbsp;</td>
          <td class="paramname"> <em>settlementDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a>&nbsp;</td>
          <td class="paramname"> <em>tolerance</em> = <code>1.0e-10</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gf38bdb4c54463b1f456655efa95b5c77">Size</a>&nbsp;</td>
          <td class="paramname"> <em>maxIterations</em> = <code>10000</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gede435af51236692b1107d7639581d39">Rate</a>&nbsp;</td>
          <td class="paramname"> <em>guess</em> = <code>0.05</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Internal rate of return. 
<p>
The IRR is the interest rate at which the NPV of the cash flows equals the given market price. The function verifies the theoretical existance of an IRR and numerically establishes the IRR to the desired precision. 
</div>
</div><p>
<a class="anchor" name="e40ebdc4a70ff54f7eb55b4457a332e2"></a><!-- doxytag: member="QuantLib::CashFlows::duration" ref="e40ebdc4a70ff54f7eb55b4457a332e2" args="(const Leg &amp;leg, const InterestRate &amp;y, Duration::Type type=Duration::Modified, Date settlementDate=Date())" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__types.html#g14fb8fca43a68f4168654e1f9f7e22f7">Time</a> duration           </td>
          <td>(</td>
          <td class="paramtype">const Leg &amp;&nbsp;</td>
          <td class="paramname"> <em>leg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_interest_rate.html">InterestRate</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Duration::Type&nbsp;</td>
          <td class="paramname"> <em>type</em> = <code>Duration::Modified</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_quant_lib_1_1_date.html">Date</a>&nbsp;</td>
          <td class="paramname"> <em>settlementDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Cash-flow duration. 
<p>
The simple duration of a string of cash flows is defined as <p class="formulaDsp">
<img class="formulaDsp" alt="\[ D_{\mathrm{simple}} = \frac{\sum t_i c_i B(t_i)}{\sum c_i B(t_i)} \]" src="form_58.png">
<p>
 where <img class="formulaInl" alt="$ c_i $" src="form_59.png"> is the amount of the <img class="formulaInl" alt="$ i $" src="form_60.png">-th cash flow, <img class="formulaInl" alt="$ t_i $" src="form_61.png"> is its payment time, and <img class="formulaInl" alt="$ B(t_i) $" src="form_62.png"> is the corresponding discount according to the passed yield.<p>
The modified duration is defined as <p class="formulaDsp">
<img class="formulaDsp" alt="\[ D_{\mathrm{modified}} = -\frac{1}{P} \frac{\partial P}{\partial y} \]" src="form_63.png">
<p>
 where <img class="formulaInl" alt="$ P $" src="form_45.png"> is the present value of the cash flows according to the given IRR <img class="formulaInl" alt="$ y $" src="form_13.png">.<p>
The Macaulay duration is defined for a compounded IRR as <p class="formulaDsp">
<img class="formulaDsp" alt="\[ D_{\mathrm{Macaulay}} = \left( 1 + \frac{y}{N} \right) D_{\mathrm{modified}} \]" src="form_64.png">
<p>
 where <img class="formulaInl" alt="$ y $" src="form_13.png"> is the IRR and <img class="formulaInl" alt="$ N $" src="form_36.png"> is the number of cash flows per year. 
</div>
</div><p>
<a class="anchor" name="4b45567c608fe19776209fd039c1b7fc"></a><!-- doxytag: member="QuantLib::CashFlows::convexity" ref="4b45567c608fe19776209fd039c1b7fc" args="(const Leg &amp;leg, const InterestRate &amp;y, Date settlementDate=Date())" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> convexity           </td>
          <td>(</td>
          <td class="paramtype">const Leg &amp;&nbsp;</td>
          <td class="paramname"> <em>leg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_quant_lib_1_1_interest_rate.html">InterestRate</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_quant_lib_1_1_date.html">Date</a>&nbsp;</td>
          <td class="paramname"> <em>settlementDate</em> = <code><a class="el" href="class_quant_lib_1_1_date.html">Date</a>()</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Cash-flow convexity. 
<p>
The convexity of a string of cash flows is defined as <p class="formulaDsp">
<img class="formulaDsp" alt="\[ C = \frac{1}{P} \frac{\partial^2 P}{\partial y^2} \]" src="form_65.png">
<p>
 where <img class="formulaInl" alt="$ P $" src="form_45.png"> is the present value of the cash flows according to the given IRR <img class="formulaInl" alt="$ y $" src="form_13.png">. 
</div>
</div><p>

</div>

<div class="footer">
<div class="endmatter">
Documentation generated by
<a href="http://www.doxygen.org">Doxygen</a> 1.5.4
</div>
</div>

</div>

</body>
</html>