public class CubicSplineInterpolation1D extends AbstractInterpolation
The natural cubic spline is piecewise cubic and twice continuously differentiable. Furthermore, its second derivative is zero at the end points.
Like polynomial interpolation, spline interpolation incurs a smaller error than linear interpolation and the interpolant is smoother. However, the interpolant is easier to evaluate than the high-degree polynomials used in polynomial interpolation. It also does not suffer from Runge's phenomenon.
| Constructor and Description |
|---|
CubicSplineInterpolation1D(double[] x,
double[] y)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
rawinterp(int j,
double x)
Subclasses provide this as the actual interpolation method.
|
java.lang.String |
toString() |
interpolate, searchpublic CubicSplineInterpolation1D(double[] x,
double[] y)
public double rawinterp(int j,
double x)
AbstractInterpolationrawinterp in class AbstractInterpolationj - the value jlo is such that x is (insofar as possible)
centered in the subrange xx[j..j+m-1], where xx is the stored data.x - interpolate at this valuepublic java.lang.String toString()
toString in class java.lang.Object