-   Forums
     -   Articles and Whitepapers
     -   Downloads
     -   Courses and Events
     -   Course Registration
     -   Distance learning
     -   Courses for Universities
     -   Books
     -   Audios and Demos
     -   Testimonials

Follow datasim on Twitter
Share this page: 

Advanced C++ and Boost C++ Libraries and Applications to Computational Finance - (code CPP-CF)

The main goal of this intensive four-day course is to learn the new features in C++11 and apply them to creating code for applications in computational finance. In particular, we show how these features can be used to improve the performance and flexibility of code. We also discuss in detail important libraries and extensions in the new standard as well as the support for multiparadigm software design (combining the object-oriented, generic and functional programming models). The combination of these new features in the language help in improving the overall quality of both existing and new applications.

This course deals with advanced topics at a brisk pace and those attending should be experienced C++ developers. If in doubt, please do not hesitate to contact me dduffy@datasim.nl. The percentage theory/practice is approximately 80% / 20%. Source code is provided for all topics and answers to questions.

This course is a major upgrade and extension to Datasim’s existing C++ courses. A distance-learning version of this course is also planned for Q1 2015. If you are interested in an in-company course, please contact me at the above address.

C++ 11 is a major advancement in the evolution of C+ + and this course covers the features in the latest revision.

Subjects Covered
. Major new language features in C++11.
. Applying C++11 to computational finance.

. Integrating and extending design patterns to a multiparadigm version.

. Using C++11 and Boost C++ libraries as part of the solution.

. Applications: Lattices, Finite Difference Method (FDM), Mont Carlo simulation.

Your Trainer

Daniel J. Duffy has been using C++ in the role of programmer, designer and trainer since 1989. He has been involved in a wide range of applications such as computer graphics, holography, process control, numerical analysis and computational finance. Activities also entail setting up C++ and Boost C++ courses from novice to expert level. He is author of several books on software design, C++ and applications to Computational Finance.

Daniel J. Duffy has a PhD from Dublin University (Trinity College).

Course contents updated November 2014

Course Contents

Part 1 New Language Features in C++11

We introduce the most important new features in C++11 that improve the effectiveness of C++ in general and that help developers write more efficient and flexible code. In one sense these feature allow C++ 11 to be called a “better C++”.

New Language Features, I Keywords
  • auto
  • decltype
  • noexcept
  • constexpr
  • nullptr
New Language Features, II
  • Uniform initialization and initializer lists
  • Default template parameters
  • Function declaration syntax
  • New fundamental data types
Move Semantics
  • What is move?
  • Copying versus moving: performance
  • Rvalue references
  • Move constructor and move assignment
Part 2 Multiparadigm Software Design in C++11

In this section we discuss support for object-oriented, generic and functional programming in C++ and how they can be combined to produce the most appropriate and flexible solution to a given problem. We also show how to improve and upgrade the object-oriented Gang-of-Four (GOF) design patterns to patterns based on a multiparadigm model. An important topic here is C++11 support for functional programming and lambda functions.

Modelling Functions Background
  • Function pointers
  • Function overloading and virtual functions
  • The categories of polymorphic behaviour
  • Using (and misusing) inheritance to realise subtype polymorphism

Fundamentals of Functional Programming (FP)
  • Short history of FP
  • Higher-order functions
  • Recursion; passing a function to itself
  • Strict and non-strict (delayed) evaluation
  • Pure functions and lambda functions
Functional Programming
  • Functions and Data
  • Function composition
  • Closures
  • Currying and uncurrying
  • Fold and continuations
Functional Programming in C++
  • Overview C++ as a multi-paradigm programming language
  • Universal function type (polymorphic) wrappers (std::function)
  • Binders and predefined function objects (std::bind)
  • Lambda functions versus binders
  • A uniform function framework
Lambda Functions
  • What is a lambda function?
  • The closure of a lambda function
  • Using lambda functions with auto
  • The mutable keyword
Using Lambda Functions
  • Configuring applications
  • With algorithms
  • As sorting criteria
  • As hash function
  • Lambda functions versus function objects
A Taxonomy of Functions in C++
  • Function pointers and free functions
  • Object and static member functions
  • Function objects
  • Lambda functions
  • Events and signals (Boost signals2 library)

 An Introduction to Software Connection Architectures

  • Object Connection Architecture (OCA)
  • Interface Connection Architecture (ICA)
  • Plug and Socket Architecture (P&S)
  • Synchronous and asynchronous communication
High-level Design and Specification of Software Components
  • The inside and the outside of a component
  • Components and Services
  • From Services to Interfaces: data and behaviour
  • Data structures
  • Exception handling
Interfaces and Contracts
  • Provides and requires interfaces
  • Contracts, preconditions and postconditions
  • Interface standardisation
Migrating from GOF to new Paradigms
  • Background and bottlenecks
  • Why a multi-paradigm approach resolves problems
  • Design approach
  • Guidelines
Essential Design Patterns, next Generation
  • Builder with std::tuple<>
  • Bridge, Strategy, Template Method with std::function<>
  • From Observer to Boost signals2
  • Mediator and loose coupling
  • Applications to computational finance
Part 3 C++11 Libraries
We discuss some libraries in C++11.
  • Modelling n-tuples (pair is a 2-tuple)
  • Using tuples as function arguments and as return types
  • Accessing the elements of a tuple
  • Advantages and applications of tuples

Fixed-sized Arrays std:array<>

  • Why do we need std:array<> ?
  • Operations and abilities
  • Using arrays as C-Style arrays
  • Combining arrays and tuples
Random Numbers and Statistical Distributions
  • What are random and pseudo-random numbers?
  • Engines and distributions in C++
  • Basic engines, engine adapters; adapters with predefined parameters
  • Categories of distributions
  • Examples and applications
Parallel Design Patterns
  • Requirements and constraints for parallel programming
  • Task and data decomposition; fine-grained and coarse-grained parallelism
  • Loop-level parallelism
  • Geometric decomposition
  • Shared queue and Producer-Consumer
  • Master-Worker
Introduction to OpenMP
  • What is OpenMP?
  • Data clauses
  • Synchronisation
  • Work Sharing
C++ 11 Concurrency Fundamentals
  • Threads in C++; properties
  • Promises and return arguments
  • Threads in detail
  • Mutexes and locks
Advanced Concurrency
  • Synchronisation and condition variables
  • Futures and async()
  • Launch policies
  • Waiting and polling
  • Example: Producer-Consumer pattern
Part 4 Essential Boost C++ Libraries

Several Boost C++ libraries have made their way into the C++ standard. There are many other Boost C++ libraries that are not part of the standard but are nonetheless important for computational finance. We scope the discussion by focusing on four libraries that we think are most relevant in the current context.

  • uBLAS (Matrix library)
  • signals2 (events and callback functions)
  • Math Toolkit
  • Multi array
Part 5 Applications I

In this section we design and implement frameworks and applications based on the material from the first four parts. We take a number of well-known cases and the new design can be compared with previous solutions in terms of flexibility, functionality and maintainability. In particular, a layered multiparadigm design is a major improvement on a pure object-oriented approach.

The objective is to take a well-known problem (in this case a binomial option pricing framework) and design it A-Z.  The knowledge gained can then be used to design other applications as there are many similarities.

Layers Pattern
  • Levels of abstraction
  • Designing layered systems: the steps
  • Layer interfacing and decoupling
  • Application areas (lattice, FDM, Monte Carlo)
Lattice Models: Financial Model
  • One-factor and two-factor models
  • Plain, Bermudan and American options
  • Chooser and compound options
  • Dividends and sensitivities
  • Binomial trees for the short rate; calibration

Lattice Models: Data Structures

  • Modelling lattice structures: nested vectors, map, C++11 unordered map
  • Using Boost uBLAS and Eigen libraries
  • Forward induction to create lattices
  • Using Boost date as time dimension
  • Lattices whose nodes are composite data types
Lattice Models: Algorithms
  • The flexibility of std::function<>
  • Backward induction algorithms
  • Option sensitivities and std::tuple<>
  • Multiple lattices and parallel processing
  • Yield fitting for interest rate models (e.g. BDT)
Lattice Models: Configuration
  • User-level creational design patterns
  • Creating reusable libraries with function objects and lambda functions
  • Configuring the application with Builder design pattern and std::tuple<>
Review of New Design
  • The advantages of layering and multiparadigm design
  • Comparison with procedural and object-oriented designs
  • Induction: generalisation to other methods in computational finance
  • Reasoning by analogy
  • Standardisation of patterns and interfaces
Part 6 Applications II

We extend the design techniques from Part 5 to a number of applications in computational finance. We focus on the Finite Difference Method (FDM) and the Monte Carlo methods as representative test cases. We compare and contrast designs based on the pure object-oriented approach with those based on a multiparadigm approach.

A Finite Difference Framework
  • Scoping the problem
  • Using the GOF (Gang-of-Four) design approach
  • Alternative designs
  • Performance testing
  • Extending the framework
A Monte Carlo Framework
  • Scoping the problem
  • Top-down system decomposition
  • Identifying software components and their interfaces
  • Component responsibilities and policy-based design

Multiparadigm Design for Monte Carlo

  • Mediator pattern and loose coupling
  • Using std::function<> as universal system interface
  • Modelling events using Boost signals2
  • System configuration
Part 7 C++ Interoperability

In this section we show how to write applications in which C++ interoperates with other languages and applications. Many real-life software systems typically consist of a mixture of programming languages,  user interfaces, database systems and third-party libraries. To this end, we discuss a number of important cases. A particular case of interest is the integration involving C++, C++/CLI and C#.

Excel Object Model
  • Excel COM Automation objects
  • Collections, books, sheets, ranges, cells, charts
  • Chart Wizard
  • Connecting to the Excel application
Creating Excel AddIns
  • ATL projects with IDTExtensibility2 support
  • Managed and unmanaged add-ins
  • VS add-ins and shared add-ins
  • Differences between C# and C++ add-in implementations
  • Shared Add-in Wizard
  • Extendibility projects
COM Add-ins in C# and C++
  • Implementing the IDTExtensibility2 interface
  • COM add-in and the Registry: loading options
  • Adding a menu item to the add-in
  • Menu item event handler
  • Using COM add-ins
Introduction to C++/CLI
  • What is C++/CLI?
  • Native and managed classes
  • Memory and garbage collection
  • Interfaces
  • Templates versus generics


  • Calling Native C++ from C#
  • Calling C# from Native C++
  • C++/CLI and Excel integration
  • .NET and Boost integration


Experienced C++ quant developers.

Who should attend?

This course is for experienced quant developers who use C++ to develop and extend software systems in computational finance.

Duration, price, date, locations and registration

Course duration: 4 days.
Course price: € 3300.-- ex. VAT.
€ 3993.-- inc. 21% VAT.
Dates and location: (click on dates to print registration form)

Date(s) Location Price Language
No dates yet.

This course can be organised on-demand. Call Datasim (+31-72-2204802) or e-mail for more information about the possibilities.

Share this page: