CHAPTER 10New Data Types, Containers and Algorithms in C++ and Boost C++ Libraries

10.1 Introduction and Objectives

In this chapter we introduce a number of features and libraries in C++ (and Boost) that we shall use throughout this book. In general, we use these libraries as utilities and building blocks in a range of applications. We discuss the essential functionality that is relevant to the topics in this book while functionality that we do not need will not be included. For more information on the Boost C++ libraries, see Demming and Duffy (2010, 2012).

In general, we complete our discussion of C++ syntax and functionality in this chapter before proceeding to applications beginning in Chapter 11.

10.2 Overview of New Features

In this chapter we assemble a number of data types and containers in one place. They are useful building blocks that we can embed and use in code using modelling techniques such as composition and inheritance. In particular, we focus on compile-time and run-time matrices that play a fundamental role in scientific applications. We shall need them in later chapters:

  • The binomial and trinomial methods.
  • Partial differential equations and the finite difference method.
  • Creating lookup tables for statistical distributions.
  • Using ‘bit matrices' as components in the solution of nonlinear systems of equations, for example using Differential Evolution (see Price, Storn and Lampinen, 1996).

In most cases we are interested in working with matrices whose elements ...

Get Financial Instrument Pricing Using C++, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.