QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CurveState Class Referenceabstract

Curve state for market-model simulations More...

#include <curvestate.hpp>

+ Inheritance diagram for CurveState:
+ Collaboration diagram for CurveState:

Public Member Functions

 CurveState (const std::vector< Time > &rateTimes)
 
virtual ~CurveState ()=default
 

Inspectors

Size numberOfRates_
 
std::vector< TimerateTimes_
 
std::vector< TimerateTaus_
 
Size numberOfRates () const
 
const std::vector< Time > & rateTimes () const
 
const std::vector< Time > & rateTaus () const
 
virtual Real discountRatio (Size i, Size j) const =0
 
virtual Rate forwardRate (Size i) const =0
 
virtual Rate coterminalSwapAnnuity (Size numeraire, Size i) const =0
 
virtual Rate coterminalSwapRate (Size i) const =0
 
virtual Rate cmSwapAnnuity (Size numeraire, Size i, Size spanningForwards) const =0
 
virtual Rate cmSwapRate (Size i, Size spanningForwards) const =0
 
virtual const std::vector< Rate > & forwardRates () const =0
 
virtual const std::vector< Rate > & coterminalSwapRates () const =0
 
virtual const std::vector< Rate > & cmSwapRates (Size spanningForwards) const =0
 
Rate swapRate (Size begin, Size end) const
 
virtual std::unique_ptr< CurveStateclone () const =0
 

Detailed Description

Curve state for market-model simulations

This class stores the state of the yield curve associated to the fixed calendar times within the simulation. This is the workhorse discounting object associated to the rate times of the simulation. It's important to pass the rates via an object like this to the product rather than directly to make it easier to switch to other engines such as a coterminal swap rate engine. Many products will not need expired rates and others will only require the first rate.

Definition at line 41 of file curvestate.hpp.

Constructor & Destructor Documentation

◆ CurveState()

CurveState ( const std::vector< Time > &  rateTimes)

Definition at line 26 of file curvestate.cpp.

+ Here is the call graph for this function:

◆ ~CurveState()

virtual ~CurveState ( )
virtualdefault

Member Function Documentation

◆ numberOfRates()

Size numberOfRates ( ) const

Definition at line 58 of file curvestate.hpp.

+ Here is the caller graph for this function:

◆ rateTimes()

const std::vector< Time > & rateTimes ( ) const

Definition at line 60 of file curvestate.hpp.

+ Here is the caller graph for this function:

◆ rateTaus()

const std::vector< Time > & rateTaus ( ) const

Definition at line 61 of file curvestate.hpp.

+ Here is the caller graph for this function:

◆ discountRatio()

virtual Real discountRatio ( Size  i,
Size  j 
) const
pure virtual

Implemented in CMSwapCurveState, CoterminalSwapCurveState, and LMMCurveState.

+ Here is the caller graph for this function:

◆ forwardRate()

virtual Rate forwardRate ( Size  i) const
pure virtual

Implemented in CMSwapCurveState, CoterminalSwapCurveState, and LMMCurveState.

+ Here is the caller graph for this function:

◆ coterminalSwapAnnuity()

virtual Rate coterminalSwapAnnuity ( Size  numeraire,
Size  i 
) const
pure virtual

Implemented in CMSwapCurveState, CoterminalSwapCurveState, and LMMCurveState.

+ Here is the caller graph for this function:

◆ coterminalSwapRate()

virtual Rate coterminalSwapRate ( Size  i) const
pure virtual

Implemented in CMSwapCurveState, CoterminalSwapCurveState, and LMMCurveState.

+ Here is the caller graph for this function:

◆ cmSwapAnnuity()

virtual Rate cmSwapAnnuity ( Size  numeraire,
Size  i,
Size  spanningForwards 
) const
pure virtual

Implemented in CMSwapCurveState, CoterminalSwapCurveState, and LMMCurveState.

+ Here is the caller graph for this function:

◆ cmSwapRate()

virtual Rate cmSwapRate ( Size  i,
Size  spanningForwards 
) const
pure virtual

Implemented in CMSwapCurveState, CoterminalSwapCurveState, and LMMCurveState.

+ Here is the caller graph for this function:

◆ forwardRates()

virtual const std::vector< Rate > & forwardRates ( ) const
pure virtual

Implemented in CMSwapCurveState, CoterminalSwapCurveState, and LMMCurveState.

+ Here is the caller graph for this function:

◆ coterminalSwapRates()

virtual const std::vector< Rate > & coterminalSwapRates ( ) const
pure virtual

Implemented in CMSwapCurveState, CoterminalSwapCurveState, and LMMCurveState.

+ Here is the caller graph for this function:

◆ cmSwapRates()

virtual const std::vector< Rate > & cmSwapRates ( Size  spanningForwards) const
pure virtual

◆ swapRate()

Rate swapRate ( Size  begin,
Size  end 
) const

Definition at line 32 of file curvestate.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clone()

virtual std::unique_ptr< CurveState > clone ( ) const
pure virtual

Member Data Documentation

◆ numberOfRates_

Size numberOfRates_
protected

Definition at line 84 of file curvestate.hpp.

◆ rateTimes_

std::vector<Time> rateTimes_
protected

Definition at line 85 of file curvestate.hpp.

◆ rateTaus_

std::vector<Time> rateTaus_
protected

Definition at line 85 of file curvestate.hpp.