JMSLTM Numerical Library 5.0.1

com.imsl.math
Class Spline2D

java.lang.Object
  extended by com.imsl.math.Spline2D
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
Spline2DInterpolate

public abstract class Spline2D
extends Object
implements Serializable, Cloneable

Represents and evaluates tensor-product splines.

The simplest method of obtaining multivariate interpolation and approximation functions is to take univariate methods and form a multivariate method via tensor products. In the case of two-dimensional spline interpolation, the derivation proceeds as follows. Let t_x be a knot sequence for splines of order k_x, and t_y be a knot sequence for splines of order k_y. Let N_x + k_x be the length of t_x, and N_y + k_x be the length of t_y. Then, the tensor-product spline has the following form.

sumlimits_{m = 0}^{N_y  - 1} {sumlimits_{n = 0}^{N_x  - 1} {c_{nm} B_{n,k_x ,t_x } left( x right)B_{m,k_y ,t_y } left( y right)} }

Given two sets of points

left{ {x_i } right}_{i = 1}^{N_x }

and

left{ {y_j } right}_{j = 1}^{N_y }

for which the corresponding univariate interpolation problem can be solved, the tensor-product interpolation problem finds the coefficients c_{nm} so that

sumlimits_{m = 0}^{N_y  - 1} {sumlimits_{n = 0}^{N_x  - 1} {c_{nm} B_{n,k_x ,t_x } left( {x_i } right)B_{m,k_y ,t_y } left( {y_j } right)} }  = f_{ij}

This problem can be solved efficiently by repeatedly solving univariate interpolation problems as described in de Boor (1978, p. 347).

See Also:
Spline2DInterpolate.html Example, Serialized Form

Constructor Summary
Spline2D()
           
 
Method Summary
 double[][] derivative(double[] xVec, double[] yVec, int xPartial, int yPartial)
          Returns the values of the partial derivative of the tensor-product spline of an array of points.
 double derivative(double x, double y, int xPartial, int yPartial)
          Returns the value of the partial derivative of the tensor-product spline at the point (x, y).
 double[][] getCoefficients()
          Returns the coefficients for the tensor-product spline.
 double[] getXKnots()
          Returns the knot sequences in the x-direction.
 double[] getYKnots()
          Returns the knot sequences in the y-direction.
 double[][] value(double[] xVec, double[] yVec)
          Returns the values of the tensor-product spline of an array of points.
 double value(double x, double y)
          Returns the value of the tensor-product spline at the point (x, y).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Spline2D

public Spline2D()
Method Detail

derivative

public double[][] derivative(double[] xVec,
                             double[] yVec,
                             int xPartial,
                             int yPartial)
Returns the values of the partial derivative of the tensor-product spline of an array of points.

Parameters:
xVec - a double array specifying the x-coordinates at which the spline is to be evaluated.
yVec - a double array specifying the y-coordinates at which the spline is to be evaluated.
xPartial - an int scalar specifying the x-partial derivative.
yPartial - an int scalar specifying the y-partial derivative.
Returns:
an xVec.length by yVec.length double matrix containing the values of the partial derivatives

frac{{partial ^{i + j} s}}{{partial ^i x,,partial ^j y}}

where i = xPartial and j = yPartial, at each (x, y).

derivative

public double derivative(double x,
                         double y,
                         int xPartial,
                         int yPartial)
Returns the value of the partial derivative of the tensor-product spline at the point (x, y).

Parameters:
x - a double scalar specifying the x-coordinate of the evaluation point for the tensor-product spline.
y - a double scalar specifying the y-coordinate of the evaluation point for the tensor-product spline.
xPartial - an int scalar specifying the x-partial derivative.
yPartial - an int scalar specifying the y-partial derivative.
Returns:
a double scalar containing the value of the partial derivative

frac{{partial ^{i + j} s}}{{partial ^i x,,partial ^j y}}

where i = xPartial and j = yPartial, at (x, y).

getCoefficients

public double[][] getCoefficients()
Returns the coefficients for the tensor-product spline.

Returns:
an xData.length by yData.length double matrix containing the coefficients.

getXKnots

public double[] getXKnots()
Returns the knot sequences in the x-direction.

Returns:
a double array of size xData.length + xOrder containing the knot sequences of the spline in the x-direction.

getYKnots

public double[] getYKnots()
Returns the knot sequences in the y-direction.

Returns:
a double array of size yData.length + yOrder containing the knot sequences of the spline in the y-direction.

value

public double[][] value(double[] xVec,
                        double[] yVec)
Returns the values of the tensor-product spline of an array of points.

Parameters:
xVec - a double array specifying the x-coordinates at which the spline is to be evaluated.
yVec - a double array specifying the y-coordinates at which the spline is to be evaluated.
Returns:
an xVec.length by yVec.length double matrix containing the values evaluated.

value

public double value(double x,
                    double y)
Returns the value of the tensor-product spline at the point (x, y).

Parameters:
x - a double scalar specifying the x-coordinate of the evaluation point for the tensor-product spline.
y - a double scalar specifying the y-coordinate of the evaluation point for the tensor-product spline.
Returns:
a double scalar containing the value of the tensor-product spline.

JMSLTM Numerical Library 5.0.1

Copyright © 1970-2008 Visual Numerics, Inc.
Built July 8 2008.