Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
List of all members
PriceTermStructure Class Referenceabstract

Price term structure. More...

#include <qle/termstructures/pricetermstructure.hpp>

+ Inheritance diagram for PriceTermStructure:
+ Collaboration diagram for PriceTermStructure:

Public Member Functions

Constructors
 PriceTermStructure (const QuantLib::DayCounter &dc=QuantLib::DayCounter())
 
 PriceTermStructure (const QuantLib::Date &referenceDate, const QuantLib::Calendar &cal=QuantLib::Calendar(), const QuantLib::DayCounter &dc=QuantLib::DayCounter())
 
 PriceTermStructure (QuantLib::Natural settlementDays, const QuantLib::Calendar &cal, const QuantLib::DayCounter &dc=QuantLib::DayCounter())
 
Prices
QuantLib::Real price (QuantLib::Time t, bool extrapolate=false) const
 
QuantLib::Real price (const QuantLib::Date &d, bool extrapolate=false) const
 
Observer interface
void update () override
 
virtual QuantLib::Time minTime () const
 The minimum time for which the curve can return values. More...
 
virtual const QuantLib::Currency & currency () const =0
 The currency in which prices are expressed. More...
 
virtual std::vector< QuantLib::Date > pillarDates () const =0
 The pillar dates for the PriceTermStructure. More...
 

Protected Member Functions

Calculations

This method must be implemented in derived classes to perform the actual calculations.

virtual QuantLib::Real priceImpl (QuantLib::Time) const =0
 Price calculation. More...
 
void checkRange (QuantLib::Time t, bool extrapolate) const
 Extra time range check for minimum time, then calls TermStructure::checkRange. More...
 

Detailed Description

Price term structure.

This abstract class defines the interface of concrete price term structures which will be derived from this one.

Definition at line 39 of file pricetermstructure.hpp.

Constructor & Destructor Documentation

◆ PriceTermStructure() [1/3]

PriceTermStructure ( const QuantLib::DayCounter &  dc = QuantLib::DayCounter())

Definition at line 25 of file pricetermstructure.cpp.

◆ PriceTermStructure() [2/3]

PriceTermStructure ( const QuantLib::Date &  referenceDate,
const QuantLib::Calendar &  cal = QuantLib::Calendar(),
const QuantLib::DayCounter &  dc = QuantLib::DayCounter() 
)

◆ PriceTermStructure() [3/3]

PriceTermStructure ( QuantLib::Natural  settlementDays,
const QuantLib::Calendar &  cal,
const QuantLib::DayCounter &  dc = QuantLib::DayCounter() 
)

Member Function Documentation

◆ price() [1/2]

QuantLib::Real price ( QuantLib::Time  t,
bool  extrapolate = false 
) const
+ Here is the caller graph for this function:

◆ price() [2/2]

QuantLib::Real price ( const QuantLib::Date &  d,
bool  extrapolate = false 
) const

◆ update()

void update ( )
override

Definition at line 42 of file pricetermstructure.cpp.

42{ TermStructure::update(); }

◆ minTime()

Time minTime ( ) const
virtual

The minimum time for which the curve can return values.

Reimplemented in CommodityAverageBasisPriceCurve< Interpolator >, CommodityBasisPriceCurve< Interpolator >, CommodityBasisPriceCurveWrapper, CrossCurrencyPriceTermStructure, PiecewisePriceCurve< Interpolator, Bootstrap >, InterpolatedPriceCurve< Interpolator >, and SpreadedPriceTermStructure.

Definition at line 44 of file pricetermstructure.cpp.

44 {
45 // Default implementation
46 return 0.0;
47}
+ Here is the caller graph for this function:

◆ currency()

virtual const QuantLib::Currency & currency ( ) const
pure virtual

◆ pillarDates()

virtual std::vector< QuantLib::Date > pillarDates ( ) const
pure virtual

◆ priceImpl()

virtual QuantLib::Real priceImpl ( QuantLib::Time  ) const
protectedpure virtual

◆ checkRange()

void checkRange ( QuantLib::Time  t,
bool  extrapolate 
) const
protected

Extra time range check for minimum time, then calls TermStructure::checkRange.

Definition at line 49 of file pricetermstructure.cpp.

49 {
50 QL_REQUIRE(extrapolate || allowsExtrapolation() || t >= minTime() || close_enough(t, minTime()),
51 "time (" << t << ") is before min curve time (" << minTime() << ")");
52
53 // Now, do the usual TermStructure checks
54 TermStructure::checkRange(t, extrapolate);
55}
virtual QuantLib::Time minTime() const
The minimum time for which the curve can return values.
Filter close_enough(const RandomVariable &x, const RandomVariable &y)
+ Here is the call graph for this function: