Class BilinearInterpolatingFunction
- java.lang.Object
-
- org.hipparchus.analysis.interpolation.BilinearInterpolatingFunction
-
- All Implemented Interfaces:
Serializable,BivariateFunction,FieldBivariateFunction
public class BilinearInterpolatingFunction extends Object implements BivariateFunction, FieldBivariateFunction, Serializable
Interpolate grid data using bi-linear interpolation.This interpolator is thread-safe.
- Since:
- 1.4
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BilinearInterpolatingFunction(double[] xVal, double[] yVal, double[][] fVal)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetXInf()Get the lowest grid x coordinate.doublegetXSup()Get the highest grid x coordinate.doublegetYInf()Get the lowest grid y coordinate.doublegetYSup()Get the highest grid y coordinate.doublevalue(double x, double y)Compute the value for the function.<T extends CalculusFieldElement<T>>
Tvalue(T x, T y)Compute the value for the function.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hipparchus.analysis.FieldBivariateFunction
toCalculusFieldBivariateFunction
-
-
-
-
Constructor Detail
-
BilinearInterpolatingFunction
public BilinearInterpolatingFunction(double[] xVal, double[] yVal, double[][] fVal) throws MathIllegalArgumentExceptionSimple constructor.- Parameters:
xVal- All the x-coordinates of the interpolation points, sorted in increasing order.yVal- All the y-coordinates of the interpolation points, sorted in increasing order.fVal- The values of the interpolation points on all the grid knots:fVal[i][j] = f(xVal[i], yVal[j]).- Throws:
MathIllegalArgumentException- if grid size is smaller than 2 or if the grid is not sorted in strict increasing order
-
-
Method Detail
-
getXInf
public double getXInf()
Get the lowest grid x coordinate.- Returns:
- lowest grid x coordinate
-
getXSup
public double getXSup()
Get the highest grid x coordinate.- Returns:
- highest grid x coordinate
-
getYInf
public double getYInf()
Get the lowest grid y coordinate.- Returns:
- lowest grid y coordinate
-
getYSup
public double getYSup()
Get the highest grid y coordinate.- Returns:
- highest grid y coordinate
-
value
public double value(double x, double y)Compute the value for the function.- Specified by:
valuein interfaceBivariateFunction- Parameters:
x- Abscissa for which the function value should be computed.y- Ordinate for which the function value should be computed.- Returns:
- the value.
-
value
public <T extends CalculusFieldElement<T>> T value(T x, T y)
Compute the value for the function.- Specified by:
valuein interfaceFieldBivariateFunction- Type Parameters:
T- type of the field elements- Parameters:
x- Abscissa for which the function value should be computed.y- Ordinate for which the function value should be computed.- Returns:
- the value.
- Since:
- 1.5
-
-