Class LinearInterpolator
java.lang.Object
org.apache.commons.math4.analysis.interpolation.LinearInterpolator
- All Implemented Interfaces:
UnivariateInterpolator
public class LinearInterpolator extends java.lang.Object implements UnivariateInterpolator
Implements a linear function for interpolation of real univariate functions.
-
Constructor Summary
Constructors Constructor Description LinearInterpolator() -
Method Summary
Modifier and Type Method Description PolynomialSplineFunctioninterpolate(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, NonMonotonicSequenceExceptionComputes a linear interpolating function for the data set.- Specified by:
interpolatein 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- ifxandyhave different sizes.NonMonotonicSequenceException- ifxis not sorted in strict increasing order.NumberIsTooSmallException- if the size ofxis smaller than 2.
-