Class ShepardInterpolator
java.lang.Object
com.irurueta.numerical.interpolation.BaseRadialBasisFunctionInterpolator
com.irurueta.numerical.interpolation.ShepardInterpolator
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
FieldsModifier and TypeFieldDescriptionprivate 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
ConstructorsConstructorDescriptionShepardInterpolator
(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 TypeMethodDescriptiondouble
interpolate
(double[] pt) Returns the interpolated function value at a dim-dimensional point pt.Methods inherited from class com.irurueta.numerical.interpolation.BaseRadialBasisFunctionInterpolator
rad
-
Field Details
-
vals
private final double[] valsValues of function at provided points. Must have the same length as the number of rows of provided points matrix. -
pneg
private final double pnegNegative 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 classBaseRadialBasisFunctionInterpolator
- Parameters:
pt
- dim-dimensional point where interpolation must be computed.- Returns:
- result of interpolation.
- Throws:
IllegalArgumentException
- if provided point has an invalid length.
-