Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Pricing.h File Reference

Detailed Description

Standalone function templates for Monte Carlo and lattice pricing of options. The purpose is to take the pricing code out of the class Option and also to to get around rigid interfaces which have to be implemented.

The functions are parametrized both by the type of Lattice and the type of Option. In the case of lattice we have no choice since Lattice is itself a class template which defines a family of types (parametrized by NodeType) which have no common base type. The type of Option is made a template parameter to gain more flexibility for the various types of Options: the concrete Option classes do not have to implement all the member functions which are used here.

For example the base class Option itself implements nothing and the subclasses of Option which become the actual template parameters can implement these methods selectively to enable selected functionality: lattice pricing or Monte Carlo pricing or both. The function templates are instantiated only at the point of actual use (function call). The compiler then looks for the necessary pieces (here member functions) from the actual template parameters and if all are found the function comes into being otherwise a compiler error results.

This approach provides enormous flexibility. Classes no longer have to conform to well defined interfaces as in a traditional inheritance hierachy. There is a price however: if you want to implement your own Option and Lattice classes and make use of these function templates you will have to read the source code to understand what methods these classes have to provide and how they are used.

Definition in file Pricing.h.

#include "TypedefsMacros.h"
#include "Array.h"
#include <vector>

Go to the source code of this file.


namespace  Pricing

Generated on Mon Sep 22 02:16:32 2003 for Libor-Library by doxygen1.3-rc3