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

public Class TricubicSplineInterpolatingFunction

Additional top-level class in compilation unit: TricubicSplineFunction.

extends Object
implements TrivariateFunction
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.analysis.TrivariateFunction
Annotations
@Deprecated
Imports
org.apache.commons.math3.analysis.TrivariateFunction, org.apache.commons.math3.exception.DimensionMismatchException, .NoDataException, .NonMonotonicSequenceException, .OutOfRangeException, org.apache.commons.math3.util.MathArrays

Deprecated

To be removed in 4.0 (see MATH-1166).

Function that implements the tricubic spline interpolation, as proposed in
Tricubic interpolation in three dimensions, F. Lekien and J. Marsden, Int. J. Numer. Meth. Engng 2005; 63:455-471
Since
2.2

Field Summary

Modifier and TypeField and Description
private static final double[][]
AINV

Matrix to compute the spline coefficients from the function values and function derivatives values

private final TricubicSplineFunction[][][]
splines

Set of cubic splines pacthing the whole data grid

private final double[]
xval

Samples x-coordinates

private final double[]
yval

Samples y-coordinates

private final double[]
zval

Samples z-coordinates

Constructor Summary

AccessConstructor and Description
public
TricubicSplineInterpolatingFunction(double[]
Sample values of the x-coordinate, in increasing order.
x
,
double[]
Sample values of the y-coordinate, in increasing order.
y
,
double[]
Sample values of the y-coordinate, in increasing order.
z
,
double[][][]
Values of the function on every grid point.
f
,
double[][][]
Values of the partial derivative of function with respect to x on every grid point.
dFdX
,
double[][][]
Values of the partial derivative of function with respect to y on every grid point.
dFdY
,
double[][][]
Values of the partial derivative of function with respect to z on every grid point.
dFdZ
,
double[][][]
Values of the cross partial derivative of function on every grid point.
d2FdXdY
,
double[][][]
Values of the cross partial derivative of function on every grid point.
d2FdXdZ
,
double[][][]
Values of the cross partial derivative of function on every grid point.
d2FdYdZ
,
double[][][]
Values of the cross partial derivative of function on every grid point.
d3FdXdYdZ
)

Method Summary

Modifier and TypeMethod and Description
private double[]

Returns:

the spline coefficients.
computeSplineCoefficients
(double[]
List of function values and function partial derivatives values.
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 int

Returns:

the index in val corresponding to the interval containing c, or -1 if c is out of the range defined by the end values of val.
searchIndex
(double
Coordinate.
c
,
double[]
Coordinate samples.
val
)

public double
value(double
x-coordinate for which the function value should be computed.
x
,
double
y-coordinate for which the function value should be computed.
y
,
double
z-coordinate for which the function value should be computed.
z
)

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

Compute the value for the function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AINVback to summary
private static final double[][] AINV

Matrix to compute the spline coefficients from the function values and function derivatives values

splinesback to summary
private final TricubicSplineFunction[][][] splines

Set of cubic splines pacthing the whole data grid

xvalback to summary
private final double[] xval

Samples x-coordinates

yvalback to summary
private final double[] yval

Samples y-coordinates

zvalback to summary
private final double[] zval

Samples z-coordinates

Constructor Detail

TricubicSplineInterpolatingFunctionback to summary
public TricubicSplineInterpolatingFunction(double[] x, double[] y, double[] z, double[][][] f, double[][][] dFdX, double[][][] dFdY, double[][][] dFdZ, double[][][] d2FdXdY, double[][][] d2FdXdZ, double[][][] d2FdYdZ, double[][][] d3FdXdYdZ) throws NoDataException, DimensionMismatchException, NonMonotonicSequenceException
Parameters
x:double[]

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

y:double[]

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

z:double[]

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

f:double[][][]

Values of the function on every grid point.

dFdX:double[][][]

Values of the partial derivative of function with respect to x on every grid point.

dFdY:double[][][]

Values of the partial derivative of function with respect to y on every grid point.

dFdZ:double[][][]

Values of the partial derivative of function with respect to z on every grid point.

d2FdXdY:double[][][]

Values of the cross partial derivative of function on every grid point.

d2FdXdZ:double[][][]

Values of the cross partial derivative of function on every grid point.

d2FdYdZ:double[][][]

Values of the cross partial derivative of function on every grid point.

d3FdXdYdZ:double[][][]

Values of the cross partial derivative of function on every grid point.

Exceptions
NoDataException:
if any of the arrays has zero length.
DimensionMismatchException:
if the various arrays do not contain the expected number of elements.
NonMonotonicSequenceException:
if x, y or z are not strictly increasing.

Method Detail

computeSplineCoefficientsback to summary
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. They must be specified in the following order:

  • f(0,0,0)
  • f(1,0,0)
  • f(0,1,0)
  • f(1,1,0)
  • f(0,0,1)
  • f(1,0,1)
  • f(0,1,1)
  • f(1,1,1)
  • fx(0,0,0)
  • ... (same order as above)
  • fx(1,1,1)
  • fy(0,0,0)
  • ... (same order as above)
  • fy(1,1,1)
  • fz(0,0,0)
  • ... (same order as above)
  • fz(1,1,1)
  • fxy(0,0,0)
  • ... (same order as above)
  • fxy(1,1,1)
  • fxz(0,0,0)
  • ... (same order as above)
  • fxz(1,1,1)
  • fyz(0,0,0)
  • ... (same order as above)
  • fyz(1,1,1)
  • fxyz(0,0,0)
  • ... (same order as above)
  • fxyz(1,1,1)
where the subscripts indicate the partial derivative with respect to the corresponding variable(s).
Parameters
beta:double[]

List of function values and function partial derivatives values.

Returns:double[]

the spline coefficients.

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

Coordinate.

val:double[]

Coordinate samples.

Returns:int

the index in val corresponding to the interval containing c, or -1 if c is out of the range defined by the end values of val.

valueback to summary
public double value(double x, double y, double z) throws OutOfRangeException

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

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

Compute the value for the function.

Parameters
x:double

x-coordinate for which the function value should be computed.

y:double

y-coordinate for which the function value should be computed.

z:double

z-coordinate for which the function value should be computed.

Returns:double

the value.

Exceptions
OutOfRangeException:
if any of the variables is outside its interpolation range.