﻿NaturalCubicSpline Class

# NaturalCubicSpline Class

Class NaturalCubicSpline represents a function determined by tabulated values. Function values are calculated using natural cubic spline interpolation.
Inheritance Hierarchy

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 7.4
Syntax
`public class NaturalCubicSpline : CubicSpline`

The NaturalCubicSpline type exposes the following members.

Constructors
NameDescription
NaturalCubicSpline
Default constructor.
NaturalCubicSpline(DoubleVector, DoubleVector)
Constructs an instance of NaturalCubicSpline for the given paired vectors of x- and y-values.
Top
Properties
NameDescription
Differentiator
Gets and sets the differentiation method object associated with this function.
(Inherited from OneVariableFunction.)
Func
Gets the function encapsulated by this object.
(Inherited from OneVariableFunction.)
Integrator
Gets and sets the integration method object associated with this function.
(Inherited from OneVariableFunction.)
NumberOfTabulatedValues
Gets the number of tabulated values.
(Inherited from TabulatedFunction.)
SecondDerivativeAtControlPoints
The second derivative at each control point of the cubic spline.
(Inherited from CubicSpline.)
Top
Methods
NameDescription
Clone
Creates a deep copy of this natural cubic spline.
(Overrides OneVariableFunctionClone.)
CoreEvaluate
Derivative
Returns the first derivative of this function.
(Inherited from OneVariableFunction.)
Differentiate
Computes the numerical derivative of the current function at the given x-value.
(Inherited from OneVariableFunction.)
Evaluate(Double)
Evaluates the current function at the given x-value.
(Inherited from OneVariableFunction.)
Evaluate(DoubleVector)
Evaluates the current function at the given set of x-values.
(Inherited from OneVariableFunction.)
Evaluate(OneVariableFunction)
Creates a composite function.
(Inherited from OneVariableFunction.)
EvaluateWithCubicSpline
GetX
Returns the value of the tabulated independent values at the specified index.
(Inherited from TabulatedFunction.)
GetXs
Gets the x, or independent, values represented by this function.
(Inherited from TabulatedFunction.)
GetXVector
Gets the x, or independent, values represented by this function.
(Inherited from TabulatedFunction.)
GetY
Returns the value of the tabulated dependent values at the specified index.
(Inherited from TabulatedFunction.)
GetYs
Gets the y, or dependent, values represented by this function.
(Inherited from TabulatedFunction.)
GetYVector
Gets the y, or dependent, values represented by this function.
(Inherited from TabulatedFunction.)
Integrate
Computes the integral of the current function over the specified interval.
(Inherited from OneVariableFunction.)
LinearInterpolation
Handles the case when there are exactly two tabulated points.
(Overrides CubicSplineLinearInterpolation(Double).)
ParabolicInterpolation
Handles the case when there are exactly three tabulated points.
(Overrides CubicSplineParabolicInterpolation(Double).)
ProcessTabulatedValues
Calculates the values for the second derivatives. From "Numerical Recipes" section 3.3
(Overrides TabulatedFunctionProcessTabulatedValues.)
SetTabulatedValues(DoubleVector, DoubleVector)
Changes the values of the tabulated function.
(Inherited from TabulatedFunction.)
SetTabulatedValues(Int32, Double, Double)
Set the values of the tabulated point at the specified index to the specified value.
(Inherited from TabulatedFunction.)
SetTabulatedValues(Range, DoubleVector, DoubleVector)
Sets the the tabulated point values in the specifed range to the specified values.
(Inherited from TabulatedFunction.)
SetX(Int32, Double)
Sets the value of the independent tabulated value at the specified index to the specified value.
(Inherited from TabulatedFunction.)
SetX(Range, DoubleVector)
Sets the the tabulated independent values in the specifed range to the specified values.
(Inherited from TabulatedFunction.)
SetY(Int32, Double)
Sets the value of the dependent tabulated value at the specified index to the specified value.
(Inherited from TabulatedFunction.)
SetY(Range, DoubleVector)
Sets the the tabulated dependent values in the specifed range to the specified values.
(Inherited from TabulatedFunction.)
Top
Fields
NameDescription
differentiator_
Differentiator
(Inherited from OneVariableFunction.)
function_
Captured function
(Inherited from OneVariableFunction.)
integrator_
Integrator
(Inherited from OneVariableFunction.)
xi_
Tabulated independent function values.
(Inherited from TabulatedFunction.)
yDoublePrime_
(Inherited from CubicSpline.)
yi_
Tabulated dependent function values.
(Inherited from TabulatedFunction.)
Top
Remarks
The natural cubic spline is a cubic spline where the second derivative of the interpolating function is required to be zero at the left and right endpoints.
Evaluating x-values outside the range of tabulated values returns the last know y-value.