Namespaces

Types in MathNet.Numerics.Interpolation

Type CubicSpline

Namespace MathNet.Numerics.Interpolation

Interfaces IInterpolation

Cubic Spline Interpolation.
Supports both differentiation and integration.

Constructors

Static Functions

Methods

Public Constructors

CubicSpline(Double[] x, Double[] c0, Double[] c1, Double[] c2, Double[] c3)

Parameters
Double[] x

sample points (N+1), sorted ascending

Double[] c0

Zero order spline coefficients (N)

Double[] c1

First order spline coefficients (N)

Double[] c2

second order spline coefficients (N)

Double[] c3

third order spline coefficients (N)

Public Static Functions

CubicSpline InterpolateAkima(IEnumerable<double> x, IEnumerable<double> y)

Create an Akima cubic spline interpolation from an unsorted set of (x,y) value pairs. Akima splines are robust to outliers.

CubicSpline InterpolateAkimaInplace(Double[] x, Double[] y)

Create an Akima cubic spline interpolation from an unsorted set of (x,y) value pairs. Akima splines are robust to outliers. WARNING: Works in-place and can thus causes the data array to be reordered.

CubicSpline InterpolateAkimaSorted(Double[] x, Double[] y)

Create an Akima cubic spline interpolation from a set of (x,y) value pairs, sorted ascendingly by x. Akima splines are robust to outliers.

CubicSpline InterpolateBoundaries(IEnumerable<double> x, IEnumerable<double> y, SplineBoundaryCondition leftBoundaryCondition, double leftBoundary, SplineBoundaryCondition rightBoundaryCondition, double rightBoundary)

Create a cubic spline interpolation from an unsorted set of (x,y) value pairs and custom boundary/termination conditions.

CubicSpline InterpolateBoundariesInplace(Double[] x, Double[] y, SplineBoundaryCondition leftBoundaryCondition, double leftBoundary, SplineBoundaryCondition rightBoundaryCondition, double rightBoundary)

Create a cubic spline interpolation from an unsorted set of (x,y) value pairs and custom boundary/termination conditions. WARNING: Works in-place and can thus causes the data array to be reordered.

CubicSpline InterpolateBoundariesSorted(Double[] x, Double[] y, SplineBoundaryCondition leftBoundaryCondition, double leftBoundary, SplineBoundaryCondition rightBoundaryCondition, double rightBoundary)

Create a cubic spline interpolation from a set of (x,y) value pairs, sorted ascendingly by x, and custom boundary/termination conditions.

CubicSpline InterpolateHermite(IEnumerable<double> x, IEnumerable<double> y, IEnumerable<double> firstDerivatives)

Create a Hermite cubic spline interpolation from an unsorted set of (x,y) value pairs and their slope (first derivative).

CubicSpline InterpolateHermiteInplace(Double[] x, Double[] y, Double[] firstDerivatives)

Create a Hermite cubic spline interpolation from an unsorted set of (x,y) value pairs and their slope (first derivative). WARNING: Works in-place and can thus causes the data array to be reordered.

CubicSpline InterpolateHermiteSorted(Double[] x, Double[] y, Double[] firstDerivatives)

Create a Hermite cubic spline interpolation from a set of (x,y) value pairs and their slope (first derivative), sorted ascendingly by x.

CubicSpline InterpolateNatural(IEnumerable<double> x, IEnumerable<double> y)

Create a natural cubic spline interpolation from an unsorted set of (x,y) value pairs and zero second derivatives at the two boundaries.

CubicSpline InterpolateNaturalInplace(Double[] x, Double[] y)

Create a natural cubic spline interpolation from an unsorted set of (x,y) value pairs and zero second derivatives at the two boundaries. WARNING: Works in-place and can thus causes the data array to be reordered.

CubicSpline InterpolateNaturalSorted(Double[] x, Double[] y)

Create a natural cubic spline interpolation from a set of (x,y) value pairs and zero second derivatives at the two boundaries, sorted ascendingly by x.

CubicSpline InterpolatePchip(IEnumerable<double> x, IEnumerable<double> y)

Create a piecewise cubic Hermite interpolating polynomial from an unsorted set of (x,y) value pairs. Monotone-preserving interpolation with continuous first derivative.

CubicSpline InterpolatePchipInplace(Double[] x, Double[] y)

Create a piecewise cubic Hermite interpolating polynomial from an unsorted set of (x,y) value pairs. Monotone-preserving interpolation with continuous first derivative. WARNING: Works in-place and can thus causes the data array to be reordered.

CubicSpline InterpolatePchipSorted(Double[] x, Double[] y)

Create a piecewise cubic Hermite interpolating polynomial from an unsorted set of (x,y) value pairs. Monotone-preserving interpolation with continuous first derivative.

Public Methods

double Differentiate(double t)

Differentiate at point t.
Parameters
double t

Point t to interpolate at.

Return
double

Interpolated first derivative at point t.

double Differentiate2(double t)

Differentiate twice at point t.
Parameters
double t

Point t to interpolate at.

Return
double

Interpolated second derivative at point t.

bool Equals(object obj)

Tuple<double, double> Extrema()

Returns the t values in the domain of the spline for which it takes the minimum and maximum value.
Return
Tuple<double, double>

A tuple containing the t value for which the spline is minimum in the first component and maximum in the second component

int GetHashCode()

Type GetType()

double Integrate(double a, double b)

Definite integral between points a and b.
Parameters
double a

Left bound of the integration interval [a,b].

double b

Right bound of the integration interval [a,b].

double Integrate(double t)

Indefinite integral at point t.
Parameters
double t

Point t to integrate at.

double Interpolate(double t)

Interpolate at point t.
Parameters
double t

Point t to interpolate at.

Return
double

Interpolated value x(t).

Double[] StationaryPoints()

Gets all the t values where the derivative is 0 see: https://mathworld.wolfram.com/StationaryPoint.html
Return
Double[]

An array of t values (in the domain of the function) where the derivative of the spline is 0

string ToString()