Package hec.lang
Class InterpolateFunction
java.lang.Object
hec.lang.InterpolateFunction
Title: InterpolateFunction - Interpolates a paired function.
It may be used as a static interpolation where the arrays of data
are not stored or as an instance of the class where the arrays are
stored so that repetitive interpolations are made by passing to the
method only the xin variable each time.
Description:
Company:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static boolean
protected static boolean
protected int
protected double[]
protected double[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Returns true if it will extrapolate in the high direction.static boolean
Returns true if it will extrapolate in the low direction.double
interpolate
(double xin) Returns interpolated value using previously stored coordinates.static double
interpolate
(double xin, int nuords, double[] xary, double[] yary) Returns interpolated value for input xin using nuords coordinate pairs of xary and yary.static double
interpolate
(double xin, int nuords, double[] xary, double[] yary, boolean extrapLow, boolean extrapHi) Returns interpolated value for input xin using nuords coordinate pairs of xary and yary.static float
interpolate
(float xin, int nuords, float[] xary, float[] yary) Returns interpolated value for input xin using nuords coordinate pairs of xary and yary.static void
void
setArrays
(int nv, double[] x, double[] y) Set arrays for instance processing.static void
SetExtrapolateHigh
(boolean extrap) Set flag for extrapolation high.static void
SetExtrapolateLow
(boolean extrap) Set flag for extrapolation low.
-
Field Details
-
extrapolateLow
protected static boolean extrapolateLow -
extrapolateHigh
protected static boolean extrapolateHigh -
numberOfOrdinates
protected int numberOfOrdinates -
xarray
protected double[] xarray -
yarray
protected double[] yarray
-
-
Constructor Details
-
InterpolateFunction
public InterpolateFunction()
-
-
Method Details
-
SetExtrapolateLow
public static void SetExtrapolateLow(boolean extrap) Set flag for extrapolation low. -
SetExtrapolateHigh
public static void SetExtrapolateHigh(boolean extrap) Set flag for extrapolation high. -
extrapolatesLow
public static boolean extrapolatesLow()Returns true if it will extrapolate in the low direction. -
extrapolatesHigh
public static boolean extrapolatesHigh()Returns true if it will extrapolate in the high direction. -
interpolate
public static double interpolate(double xin, int nuords, double[] xary, double[] yary, boolean extrapLow, boolean extrapHi) Returns interpolated value for input xin using nuords coordinate pairs of xary and yary. Extrapolation is controlled by extrapLow and extrapHi. -
interpolate
public static double interpolate(double xin, int nuords, double[] xary, double[] yary) Returns interpolated value for input xin using nuords coordinate pairs of xary and yary. -
interpolate
public static float interpolate(float xin, int nuords, float[] xary, float[] yary) Returns interpolated value for input xin using nuords coordinate pairs of xary and yary. -
setArrays
public void setArrays(int nv, double[] x, double[] y) Set arrays for instance processing. Usefull if doing repetitive interpolation of the same function. It is a 2 step process. First, call setArrays then repetitively call interpolate(final double xin). -
interpolate
public double interpolate(double xin) Returns interpolated value using previously stored coordinates. You must first call setArrays to store the arrays before calling this interpolate method. -
main
-