|
|
|
@ -102,6 +102,23 @@ namespace MathNet.Numerics |
|
|
|
return Interpolation.Barycentric.InterpolatePolynomialEquidistant(points, values); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a neville polynomial interpolation based on arbitrary points.
|
|
|
|
/// If the points happen to be equidistant, consider to use the much more robust PolynomialEquidistant instead.
|
|
|
|
/// Otherwise, consider whether RationalWithoutPoles would not be a more robust alternative.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="points">The sample points t. Supports both lists and arrays.</param>
|
|
|
|
/// <param name="values">The sample point values x(t). Supports both lists and arrays.</param>
|
|
|
|
/// <returns>
|
|
|
|
/// An interpolation scheme optimized for the given sample points and values,
|
|
|
|
/// which can then be used to compute interpolations and extrapolations
|
|
|
|
/// on arbitrary points.
|
|
|
|
/// </returns>
|
|
|
|
public static IInterpolation Polynomial(IList<double> points, IList<double> values) |
|
|
|
{ |
|
|
|
return new NevillePolynomialInterpolation(points, values); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a piecewise linear spline interpolation based on arbitrary points.
|
|
|
|
/// </summary>
|
|
|
|
@ -121,6 +138,25 @@ namespace MathNet.Numerics |
|
|
|
return Interpolation.LinearSpline.Interpolate(points, values); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create an piecewise cubic spline interpolation based on arbitrary points, with zero secondary derivatives at the boundaries.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="points">The sample points t. Optimized for arrays.</param>
|
|
|
|
/// <param name="values">The sample point values x(t). Optimized for arrays.</param>
|
|
|
|
/// <returns>
|
|
|
|
/// An interpolation scheme optimized for the given sample points and values,
|
|
|
|
/// which can then be used to compute interpolations and extrapolations
|
|
|
|
/// on arbitrary points.
|
|
|
|
/// </returns>
|
|
|
|
/// <remarks>
|
|
|
|
/// The value pairs do not have to be sorted, but if they are not sorted ascendingly
|
|
|
|
/// and the passed x and y arguments are arrays, they will be sorted inplace and thus modified.
|
|
|
|
/// </remarks>
|
|
|
|
public static IInterpolation CubicSpline(IEnumerable<double> points, IEnumerable<double> values) |
|
|
|
{ |
|
|
|
return Interpolation.CubicSpline.Interpolate(points, values); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create an piecewise cubic Akima spline interpolation based on arbitrary points. Akima splines are robust to outliers.
|
|
|
|
/// </summary>
|
|
|
|
|