org.apache.commons.math.analysis.interpolation
public class BicubicSplineInterpolatingFunction extends Object implements BivariateRealFunction
Modifier and Type | Field and Description |
---|---|
private static double[][] |
AINV
Matrix to compute the spline coefficients from the function values
and function derivatives values
|
private BivariateRealFunction[][][] |
partialDerivatives
Partial derivatives
The value of the first index determines the kind of derivatives:
0 = first partial derivatives wrt x
1 = first partial derivatives wrt y
2 = second partial derivatives wrt x
3 = second partial derivatives wrt y
4 = cross partial derivatives
|
private BicubicSplineFunction[][] |
splines
Set of cubic splines patching the whole data grid
|
private double[] |
xval
Samples x-coordinates
|
private double[] |
yval
Samples y-coordinates
|
Constructor and Description |
---|
BicubicSplineInterpolatingFunction(double[] x,
double[] y,
double[][] f,
double[][] dFdX,
double[][] dFdY,
double[][] d2FdXdY) |
Modifier and Type | Method and Description |
---|---|
private void |
computePartialDerivatives()
Compute all partial derivatives.
|
private double[] |
computeSplineCoefficients(double[] beta)
Compute the spline coefficients from the list of function values and
function partial derivatives values at the four corners of a grid
element.
|
private double |
partialDerivative(int which,
double x,
double y) |
double |
partialDerivativeX(double x,
double y) |
double |
partialDerivativeXX(double x,
double y) |
double |
partialDerivativeXY(double x,
double y) |
double |
partialDerivativeY(double x,
double y) |
double |
partialDerivativeYY(double x,
double y) |
private int |
searchIndex(double c,
double[] val) |
double |
value(double x,
double y)
Compute the value for the function.
|
private static final double[][] AINV
private final double[] xval
private final double[] yval
private final BicubicSplineFunction[][] splines
private BivariateRealFunction[][][] partialDerivatives
public BicubicSplineInterpolatingFunction(double[] x, double[] y, double[][] f, double[][] dFdX, double[][] dFdY, double[][] d2FdXdY) throws DimensionMismatchException
x
- Sample values of the x-coordinate, in increasing order.y
- Sample values of the y-coordinate, in increasing order.f
- Values of the function on every grid point.dFdX
- Values of the partial derivative of function with respect
to x on every grid point.dFdY
- Values of the partial derivative of function with respect
to y on every grid point.d2FdXdY
- Values of the cross partial derivative of function on
every grid point.DimensionMismatchException
- if the various arrays do not contain
the expected number of elements.NonMonotonousSequenceException
- if x
or y
are not strictly increasing.NoDataException
- if any of the arrays has zero length.public double value(double x, double y)
value
in interface BivariateRealFunction
x
- Abscissa for which the function value should be computed.y
- Ordinate for which the function value should be computed.public double partialDerivativeX(double x, double y)
x
- x-coordinate.y
- y-coordinate.public double partialDerivativeY(double x, double y)
x
- x-coordinate.y
- y-coordinate.public double partialDerivativeXX(double x, double y)
x
- x-coordinate.y
- y-coordinate.public double partialDerivativeYY(double x, double y)
x
- x-coordinate.y
- y-coordinate.public double partialDerivativeXY(double x, double y)
x
- x-coordinate.y
- y-coordinate.private double partialDerivative(int which, double x, double y)
which
- First index in partialDerivatives
.x
- x-coordinate.y
- y-coordinate.FunctionEvaluationException
private void computePartialDerivatives()
private int searchIndex(double c, double[] val)
c
- Coordinate.val
- Coordinate samples.val
corresponding to the interval
containing c
, or -1
if c
is out of the
range defined by the end values of val
.private double[] computeSplineCoefficients(double[] beta)
beta
- List of function values and function partial derivatives
values.Copyright (c) 2003-2013 Apache Software Foundation