Class PolynomialInterpolator
java.lang.Object
com.irurueta.numerical.interpolation.BaseInterpolator
com.irurueta.numerical.interpolation.PolynomialInterpolator
Computes polynomial interpolation.
For large sets of ata, this interpolator might return inaccurate results.
Additionally, accuracy worsens as the polynomial degree to interpolate increases.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleAn indication of interpolation error on the y values of the last call toBaseInterpolator.interpolate(double). -
Constructor Summary
ConstructorsConstructorDescriptionPolynomialInterpolator(double[] x, double[] y) Constructor.PolynomialInterpolator(double[] x, double[] y, int m) Constructor.PolynomialInterpolator(double[] x, double[] y, int m, boolean check) Constructor. -
Method Summary
Methods inherited from class com.irurueta.numerical.interpolation.BaseInterpolator
hunt, interpolate, locate
-
Field Details
-
dy
private double dyAn indication of interpolation error on the y values of the last call toBaseInterpolator.interpolate(double).
-
-
Constructor Details
-
PolynomialInterpolator
public PolynomialInterpolator(double[] x, double[] y, int m) Constructor.- Parameters:
x- x values to interpolate to. Values in x must be monotonic (either increasing or decreasing)y- y values to interpolate to.m- length of x's and y's to take into account. Must be less or equal than x or y length.- Throws:
IllegalArgumentException- if x or y have invalid length or m exceeds length of x or y.
-
PolynomialInterpolator
public PolynomialInterpolator(double[] x, double[] y, int m, boolean check) Constructor.- Parameters:
x- x values to interpolate to. Values in x must be monotonic (either increasing or decreasing)y- y values to interpolate to.m- length of x's and y's to take into account. Must be less or equal than x or y length.check- true to make validations, false otherwise.- Throws:
IllegalArgumentException- if x or y have invalid length or m exceeds length of x or y.
-
PolynomialInterpolator
public PolynomialInterpolator(double[] x, double[] y) Constructor.- Parameters:
x- x values to interpolate to. Values in x must be monotonic (either increasing or decreasing)y- y values to interpolate to.- Throws:
IllegalArgumentException- if x or y have invalid length or m exceeds length of x or y.
-
-
Method Details
-
getDy
public double getDy()Gets an indication of the error of interpolation on the y values.- Returns:
- indication of error of interpolation.
-
rawinterp
Actual interpolation method.- Specified by:
rawinterpin classBaseInterpolator- Parameters:
jl- index where value x to be interpolated in located in the array of xx.x- value to obtain interpolation for.- Returns:
- interpolated value.
- Throws:
InterpolationException- if interpolation fails.
-