From ea01dbbd296afbd212522dd691c9603442e6c8e6 Mon Sep 17 00:00:00 2001 From: Febin <25066330+febkor@users.noreply.github.com> Date: Thu, 31 Dec 2020 18:07:47 +0200 Subject: [PATCH] Add monotone spline to interpolation doc; update site menu to add links. --- docs/content/Interpolation.md | 3 ++- src/Numerics/Interpolation/CubicSpline.cs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) 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.");