Class LinearInterpolator
- java.lang.Object
-
- org.hipparchus.analysis.interpolation.LinearInterpolator
-
- All Implemented Interfaces:
UnivariateInterpolator
public class LinearInterpolator extends Object implements UnivariateInterpolator
Implements a linear function for interpolation of real univariate functions.
-
-
Constructor Summary
Constructors Constructor Description LinearInterpolator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PolynomialSplineFunction
interpolate(double[] x, double[] y)
Computes a linear interpolating function for the data set.
-
-
-
Method Detail
-
interpolate
public PolynomialSplineFunction interpolate(double[] x, double[] y) throws MathIllegalArgumentException
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:
MathIllegalArgumentException
- ifx
andy
have different sizes.MathIllegalArgumentException
- ifx
is not sorted in strict increasing order.MathIllegalArgumentException
- if the size ofx
is smaller than 2.
-
-