diff --git a/docs/content/Interpolation.md b/docs/content/Interpolation.md index 384e1d71..5f298153 100644 --- a/docs/content/Interpolation.md +++ b/docs/content/Interpolation.md @@ -37,12 +37,13 @@ Interpolation on arbitrary sample points ---------------------------------------- * *Rational pole-free*: Barycentric Floater-Hormann Algorithm -* **Rational with poles**: Bulirsch & Stoer Algorithm +* *Rational with poles*: Bulirsch & Stoer Algorithm * *Neville Polynomial*: Neville Algorithm. Note that the Neville algorithm performs very badly on equidistant points. If you need to interpolate a polynomial on equidistant points, we recommend to use the barycentric algorithm instead. * *Linear Spline* * *Cubic Spline* with boundary conditions * *Natural Cubic Spline* * *Akima Cubic Spline* +* *Monotone Cubic Spline*: Monotone-preserving piecewise cubic Hermite interpolating polynomial (PCHIP), based on Fritsch & Carlson (1980). Interpolation with additional data diff --git a/src/Numerics/Interpolation/CubicSpline.cs b/src/Numerics/Interpolation/CubicSpline.cs index cba2c54c..d2344901 100644 --- a/src/Numerics/Interpolation/CubicSpline.cs +++ b/src/Numerics/Interpolation/CubicSpline.cs @@ -216,6 +216,8 @@ namespace MathNet.Numerics.Interpolation /// public static CubicSpline InterpolatePchipSorted(double[] x, double[] y) { + // Implementation based on "Numerical Computing with Matlab" (Moler, 2004). + if (x.Length != y.Length) { throw new ArgumentException("All vectors must have the same dimensionality.");