CubicSpline Class Reference

#include <ql/Math/cubicspline.hpp>

Inheritance diagram for CubicSpline:

Inheritance graph
[legend]
List of all members.

Detailed Description

Cubic spline interpolation between discrete points.

It implements different type of end conditions: not-a-knot, first derivative value, second derivative value.

It also implements Hyman's monotonicity constraint filter which ensures that the interpolating spline remains monotonic at the expense of the second derivative of the curve which will no longer be continuous where the filter has been applied. If the interpolating spline is already monotonic, the Hyman filter leaves it unchanged.

See R. L. Dougherty, A. Edelman, and J. M. Hyman, "Nonnegativity-, Monotonicity-, or Convexity-Preserving Cubic and Quintic Hermite Interpolation" Mathematics Of Computation, v. 52, n. 186, April 1989, pp. 471-494.


Public Types

enum  BoundaryCondition {
  NotAKnot, FirstDerivative, SecondDerivative, Periodic,
  Lagrange
}

Public Member Functions

template<class I1, class I2>  CubicSpline (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, CubicSpline::BoundaryCondition leftCondition, Real leftConditionValue, CubicSpline::BoundaryCondition rightCondition, Real rightConditionValue, bool monotonicityConstraint)
const std::vector< Real > & aCoefficients () const
const std::vector< Real > & bCoefficients () const
const std::vector< Real > & cCoefficients () const


Member Enumeration Documentation

enum BoundaryCondition
 

Enumeration values:
NotAKnot  Make second(-last) point an inactive knot.
FirstDerivative  Match value of end-slope.
SecondDerivative  Match value of second derivative at end.
Periodic  Match first and second derivative at either end.
Lagrange  Match end-slope to the slope of the cubic that matches the first four data at the respective end


Constructor & Destructor Documentation

CubicSpline const I1 &  xBegin,
const I1 &  xEnd,
const I2 &  yBegin,
CubicSpline::BoundaryCondition  leftCondition,
Real  leftConditionValue,
CubicSpline::BoundaryCondition  rightCondition,
Real  rightConditionValue,
bool  monotonicityConstraint
 

Precondition:
the $ x $ values must be sorted.


QuantLib.org
QuantLib
Hosted by
SourceForge.net Logo
Documentation generated by
doxygen