Class LinearInterpolator
java.lang.Object
org.apache.commons.math3.analysis.interpolation.LinearInterpolator
- All Implemented Interfaces:
UnivariateInterpolator
Implements a linear function for interpolation of real univariate functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninterpolate
(double[] x, double[] y) Computes a linear interpolating function for the data set.
-
Constructor Details
-
LinearInterpolator
public LinearInterpolator()
-
-
Method Details
-
interpolate
public PolynomialSplineFunction interpolate(double[] x, double[] y) throws DimensionMismatchException, NumberIsTooSmallException, NonMonotonicSequenceException Computes a linear interpolating function for the data set.- Specified by:
interpolate
in interfaceUnivariateInterpolator
- Parameters:
x
- the arguments for the interpolation pointsy
- the values for the interpolation points- Returns:
- a function which interpolates the data set
- Throws:
DimensionMismatchException
- ifx
andy
have different sizes.NonMonotonicSequenceException
- ifx
is not sorted in strict increasing order.NumberIsTooSmallException
- if the size ofx
is smaller than 2.
-