Top Description Fields Constructors Methods
org.apache.commons.math3.analysis.interpolation

public Class PiecewiseBicubicSplineInterpolatingFunction

extends Object
implements BivariateFunction
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.analysis.BivariateFunction
Imports
java.util.Arrays, org.apache.commons.math3.analysis.BivariateFunction, org.apache.commons.math3.analysis.polynomials.PolynomialSplineFunction, org.apache.commons.math3.exception.DimensionMismatchException, .InsufficientDataException, .NoDataException, .NullArgumentException, .OutOfRangeException, .NonMonotonicSequenceException, org.apache.commons.math3.util.MathArrays

Function that implements the bicubic spline interpolation. This implementation currently uses AkimaSplineInterpolator as the underlying one-dimensional interpolator, which requires 5 sample points; insufficient data will raise an exception when the value method is called.
Since
3.4

Field Summary

Modifier and TypeField and Description
private final double[][]
fval

Set of cubic splines patching the whole data grid

private static final int
MIN_NUM_POINTS

The minimum number of points that are needed to compute the function.

private final double[]
xval

Samples x-coordinates

private final double[]
yval

Samples y-coordinates

Constructor Summary

AccessConstructor and Description
public
PiecewiseBicubicSplineInterpolatingFunction(double[]
Sample values of the x-coordinate, in increasing order.
x
,
double[]
Sample values of the y-coordinate, in increasing order.
y
,
double[][]
Values of the function on every grid point. the expected number of elements.
f
)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if (x, y) is a valid point.
isValidPoint
(double
First coordinate.
x
,
double
Second coordinate.
y
)

Indicates whether a point is within the interpolation range.

private int

Returns:

the index in val corresponding to the interval containing c.
searchIndex
(double
Coordinate.
c
,
double[]
Coordinate samples.
val
,
int
how far back from found value to offset for querying
offset
,
int
total number of elements forward from beginning that will be queried
count
)

public double
value(double
Abscissa for which the function value should be computed.
x
,
double
Ordinate for which the function value should be computed.
y
)

Implements org.apache.commons.math3.analysis.BivariateFunction.value.

Compute the value for the function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fvalback to summary
private final double[][] fval

Set of cubic splines patching the whole data grid

MIN_NUM_POINTSback to summary
private static final int MIN_NUM_POINTS

The minimum number of points that are needed to compute the function.

xvalback to summary
private final double[] xval

Samples x-coordinates

yvalback to summary
private final double[] yval

Samples y-coordinates

Constructor Detail

PiecewiseBicubicSplineInterpolatingFunctionback to summary
public PiecewiseBicubicSplineInterpolatingFunction(double[] x, double[] y, double[][] f) throws DimensionMismatchException, NullArgumentException, NoDataException, NonMonotonicSequenceException
Parameters
x:double[]

Sample values of the x-coordinate, in increasing order.

y:double[]

Sample values of the y-coordinate, in increasing order.

f:double[][]

Values of the function on every grid point. the expected number of elements.

Exceptions
DimensionMismatchException:
if the length of x and y don't match the row, column height of f
NullArgumentException:
if any of the arguments are null
NoDataException:
if any of the arrays has zero length.
NonMonotonicSequenceException:
if x or y are not strictly increasing.

Method Detail

isValidPointback to summary
public boolean isValidPoint(double x, double y)

Indicates whether a point is within the interpolation range.

Parameters
x:double

First coordinate.

y:double

Second coordinate.

Returns:boolean

true if (x, y) is a valid point.

Since
3.3
searchIndexback to summary
private int searchIndex(double c, double[] val, int offset, int count)
Parameters
c:double

Coordinate.

val:double[]

Coordinate samples.

offset:int

how far back from found value to offset for querying

count:int

total number of elements forward from beginning that will be queried

Returns:int

the index in val corresponding to the interval containing c.

Exceptions
OutOfRangeException:
if c is out of the range defined by the boundary values of val.
valueback to summary
public double value(double x, double y) throws OutOfRangeException

Implements org.apache.commons.math3.analysis.BivariateFunction.value.

Doc from org.apache.commons.math3.analysis.BivariateFunction.value.

Compute the value for the function.

Parameters
x:double

Abscissa for which the function value should be computed.

y:double

Ordinate for which the function value should be computed.

Returns:double

the value.