Class ShepardInterpolator

java.lang.Object
com.irurueta.numerical.interpolation.BaseRadialBasisFunctionInterpolator
com.irurueta.numerical.interpolation.ShepardInterpolator

public class ShepardInterpolator extends BaseRadialBasisFunctionInterpolator
Interpolates sparsely defined points of dimension "dim" using Shepard interpolation, which is a simplification of Radial Basis Function interpolation that achieves less accurate results but having less computational cost.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final double
    Negative value of p parameter controlling Shepard power-law function phi(r) = r^-p.
    private final double[]
    Values of function at provided points.

    Fields inherited from class com.irurueta.numerical.interpolation.BaseRadialBasisFunctionInterpolator

    dim, n, pi, pts
  • Constructor Summary

    Constructors
    Constructor
    Description
    ShepardInterpolator(com.irurueta.algebra.Matrix ptss, double[] valss)
    Constructor using default p parameter, which is equal to 2.0.
    ShepardInterpolator(com.irurueta.algebra.Matrix ptss, double[] valss, double p)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    interpolate(double[] pt)
    Returns the interpolated function value at a dim-dimensional point pt.

    Methods inherited from class com.irurueta.numerical.interpolation.BaseRadialBasisFunctionInterpolator

    rad

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • vals

      private final double[] vals
      Values of function at provided points. Must have the same length as the number of rows of provided points matrix.
    • pneg

      private final double pneg
      Negative value of p parameter controlling Shepard power-law function phi(r) = r^-p. Typically, p lies between 1 and 3.
  • Constructor Details

    • ShepardInterpolator

      public ShepardInterpolator(com.irurueta.algebra.Matrix ptss, double[] valss, double p)
      Constructor.
      Parameters:
      ptss - Matrix containing points to interpolate from. Each row contains one point. Matrix will have n points (rows) having a dimension (columns) equal to dim.
      valss - values of function at provided points. Must have the same length as the number of rows of provided points matrix.
      p - p parameter controlling Shepard power-law function phi(r) = r^-p. Typically, p lies between 1 and 3.
      Throws:
      IllegalArgumentException - if provided values array does not match the number of points (rows) in provided matrix.
    • ShepardInterpolator

      public ShepardInterpolator(com.irurueta.algebra.Matrix ptss, double[] valss)
      Constructor using default p parameter, which is equal to 2.0.
      Parameters:
      ptss - Matrix containing points to interpolate from. Each row contains one point. Matrix will have n points (rows) having a dimension (columns) equal to dim.
      valss - values of function at provided points. Must have the same length as the number of rows of provided points matrix.
      Throws:
      IllegalArgumentException - if provided values array does not match the number of points (rows) in provided matrix.
  • Method Details

    • interpolate

      public double interpolate(double[] pt)
      Returns the interpolated function value at a dim-dimensional point pt.
      Specified by:
      interpolate in class BaseRadialBasisFunctionInterpolator
      Parameters:
      pt - dim-dimensional point where interpolation must be computed.
      Returns:
      result of interpolation.
      Throws:
      IllegalArgumentException - if provided point has an invalid length.