Skip to main content

Module termstructures

Module termstructures 

Source
Expand description

Term-structure base machinery.

Port of ql/termstructure.{hpp,cpp}: the TermStructure trait is the curve contract (C++’s virtual interface) and TermStructureBase is the shared holder concrete curves embed (C++’s data members and default behaviour). A term structure keeps track of its reference date in one of three ways: a fixed date, a date moving off the evaluation date (advanced by a number of settlement days on a calendar), or a date managed by the concrete curve itself (which then overrides reference_date).

§Divergences from QuantLib

  • QuantLib’s moving mode reads the global Settings singleton; per D5 the moving constructor takes the shared Settings handle explicitly and registers with its evaluation-date observable. The date mutates through &self, so an observer may read the reference date back while the evaluation-date notification that invalidated it is still running.
  • A base asked for a reference date it does not manage returns an Err where C++ silently returns the null date.
  • C++’s Extrapolator base class is folded into the holder as a flag; it can be extracted once the interpolation layer needs it.
  • The empty Calendar/DayCounter states are Options here, per the DayCounter port convention.
  • No today’s-date fallback: C++ resolves an unset evaluation date to Date::todaysDate(); this port has no system-clock date, so a moving structure returns an Err until the evaluation date is set explicitly.
  • The moving recompute reads the constructor-stored calendar and settlement days; a curve overriding calendar or settlement_days (C++ dispatches through the virtuals) must override reference_date as well.

Re-exports§

pub use bootstraphelper::BootstrapHelperBase;
pub use bootstraphelper::RateHelper;
pub use bootstraphelper::RelativeDateRateHelper;
pub use bootstraphelper::compare_by_pillar_date;
pub use bootstraphelper::sort_by_pillar_date;

Modules§

bootstraphelper
Bootstrap-helper base for curve construction.
bootstraptraits
Bootstrap traits and the mutable node plumbing they drive.
interpolatedcurve
Helper to build interpolated term structures.
iterativebootstrap
Iterative piecewise-curve bootstrap.
volatility
Volatility term structures.
yields
Yield term structures.
yieldtermstructure
Interest-rate term structure.

Structs§

TermStructureBase
Shared base holder for term structures.

Traits§

TermStructure
Basic term-structure functionality.