Introduction xvii
1 Getting Started 1
2 Basic Data Types and Operators 17
3 Functions 37
4 Flow of Control 55
5 Working with Multiple Files 71
6 Unit Testing 85
7 Using C++ Classes 97
8 User-Defined Types 123
9 Monte Carlo Pricing in C++ 145
10 Interfaces 159
11 Arrays, Strings, and Pointers 175
12 More Sophisticated Classes 205
13 The Portfolio Class 223
14 Delta Hedging 233
15 Debugging and Development Tools 245
16 A Matrix Class 267
17 An Overview of Templates 295
18 The Standard Template Library 303
19 Function Objects and Lambda Functions 329
20 Threads 337
21 Next Steps 359
A Risk-Neutral Pricing 363
Bibliography 383
Index 385
Chapter 1: The Fixed Income Market..................................................................... 1
Chapter 2: The Equities Market ........................................................................... 25
Chapter 3: C++ Programming Techniques in Finance ......................................... 55
Chapter 4: Common Libraries for Financial Applications.................................... 83
Chapter 5: Designing Numerical Classes .......................................................... 111
Chapter 6: Plotting Financial Data .................................................................... 137
Chapter 7: Linear Algebra ................................................................................. 155
Chapter 8: Interpolation .................................................................................... 171
Chapter 9: Calculating Roots of Equations ........................................................ 183
Chapter 10: Numerical Integration .................................................................... 203
Chapter 11: Solving ODEs and PDEs ................................................................. 221
Chapter 12: Optimization................................................................................... 237
Chapter 13: Asset and Portfolio Optimization ................................................... 255
Chapter 14: Monte Carlo Methods .................................................................... 273
Chapter 15: Extending Financial Libraries ........................................................ 291
Chapter 16: Using C++ with R and Maxima ...................................................... 313
Chapter 17: Multithreading ............................................................................... 325
Appendix A: C++11/14 Features ....................................................................... 343