Package smile.interpolation
Class LinearInterpolation
java.lang.Object
smile.interpolation.AbstractInterpolation
smile.interpolation.LinearInterpolation
- All Implemented Interfaces:
Serializable
,Interpolation
Piecewise linear interpolation. Linear interpolation, sometimes known as
lerp, is quick and easy, but it is not very precise. Another disadvantage
is that the interpolant is not differentiable at the control points x.
- See Also:
-
Constructor Summary
-
Method Summary
Methods inherited from class smile.interpolation.AbstractInterpolation
interpolate, search
-
Constructor Details
-
LinearInterpolation
public LinearInterpolation(double[] x, double[] y) Constructor.- Parameters:
x
- the tabulated points.y
- the function values atx
.
-
-
Method Details
-
rawinterp
public double rawinterp(int j, double x) Description copied from class:AbstractInterpolation
Subclasses provide this as the actual interpolation method.- Specified by:
rawinterp
in classAbstractInterpolation
- Parameters:
j
- 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 value- Returns:
- the raw interpolated value.
-
toString
-