CubicSplineInterpolation Class Reference
#include <ql/math/interpolations/cubicspline.hpp>

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 in the regions of monotoniticity of the input (so, three successive increasing or decreasing values) 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 CubicSpline and Quintic Hermite Interpolation" Mathematics Of Computation, v. 52, n. 186, April 1989, pp. 471-494.
- Tests:
- the correctness of the returned values is tested by reproducing results available in literature.
Public Types | |
enum | BoundaryCondition { NotAKnot, FirstDerivative, SecondDerivative, Periodic, Lagrange } |
Public Member Functions | |
template<class I1, class I2> | |
CubicSplineInterpolation (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, CubicSplineInterpolation::BoundaryCondition leftCondition, Real leftConditionValue, CubicSplineInterpolation::BoundaryCondition rightCondition, Real rightConditionValue, bool monotonicityConstraint) | |
const std::vector< Real > & | primitiveConstants () const |
const std::vector< Real > & | aCoefficients () const |
const std::vector< Real > & | bCoefficients () const |
const std::vector< Real > & | cCoefficients () const |
const std::vector< bool > & | monotonicityAdjustments () const |
Member Enumeration Documentation
enum BoundaryCondition |
- Enumerator:
Constructor & Destructor Documentation
CubicSplineInterpolation | ( | const I1 & | xBegin, | |
const I1 & | xEnd, | |||
const I2 & | yBegin, | |||
CubicSplineInterpolation::BoundaryCondition | leftCondition, | |||
Real | leftConditionValue, | |||
CubicSplineInterpolation::BoundaryCondition | rightCondition, | |||
Real | rightConditionValue, | |||
bool | monotonicityConstraint | |||
) |
- Precondition:
- the
values must be sorted.