Class PolynomialInterpolator

java.lang.Object
com.irurueta.numerical.interpolation.BaseInterpolator
com.irurueta.numerical.interpolation.PolynomialInterpolator

public class PolynomialInterpolator extends BaseInterpolator
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 Details

  • 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

      public double rawinterp(int jl, double x) throws InterpolationException
      Actual interpolation method.
      Specified by:
      rawinterp in class BaseInterpolator
      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.