Click or drag to resize
Spline2DInterpolate Class
Computes a two-dimensional, tensor-product spline interpolant from two-dimensional, tensor-product data.
Inheritance Hierarchy

Namespace: Imsl.Math
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
[SerializableAttribute]
public class Spline2DInterpolate : Spline2D

The Spline2DInterpolate type exposes the following members.

Constructors
  NameDescription
Public methodSpline2DInterpolate(Double, Double, Double)
Constructor for Spline2DInterpolate.
Public methodSpline2DInterpolate(Double, Double, Double, Int32, Int32)
Constructor for Spline2DInterpolate.
Public methodSpline2DInterpolate(Double, Double, Double, Int32, Int32, Double, Double)
Constructor for Spline2DInterpolate.
Top
Methods
  NameDescription
Public methodDerivative(Double, Double, Int32, Int32)
Returns the value of the partial derivative of the tensor-product spline at the point (x, y).
(Inherited from Spline2D.)
Public methodDerivative(Double, Double, Int32, Int32)
Returns the values of the partial derivative of the tensor-product spline of an array of points.
(Inherited from Spline2D.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetCoefficients
Returns the coefficients for the tensor-product spline.
(Inherited from Spline2D.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetXKnots
Returns the knot sequences in the x-direction.
(Inherited from Spline2D.)
Public methodGetYKnots
Returns the knot sequences in the y-direction.
(Inherited from Spline2D.)
Public methodIntegral
Returns the value of an integral of a tensor-product spline on a rectangular domain.
(Inherited from Spline2D.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValue(Double, Double)
Returns the value of the tensor-product spline at the point (x, y).
(Inherited from Spline2D.)
Public methodValue(Double, Double)
Returns the values of the tensor-product spline of an array of points.
(Inherited from Spline2D.)
Top
Remarks

The class Spline2DInterpolate computes a tensor-product spline interpolant. The tensor-product spline interpolant to data \{(x_i, y_j, f_{ij})\}, where 0 \le i \le (n_x - 1) and 0 \le j \le (n_y - 1) has the form

\sum_{m=0}^{n_y - 1} \sum_{n=0}^{n_x-1} c_{nm}B_{n,k_x,t_x}(x) B_{m,k_y,t_y}(y)
where k_x and k_y are the orders of the splines. These numbers are defaulted to be 4, but can be set to any positive integer using xOrder and yOrder in the constructor. Likewise, t_x and t_y are the corresponding knot sequences (xKnots and yKnots). These default values are selected by Spline2DInterpolate. The algorithm requires that
t_x(k_x - 1) \le x_i \le t_x(n_x)\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,0 \le i \le n_x -1
t_y(k_y - 1) \le y_j \le t_y(n_y - 1)\,\,\,\,\,\,\,\,\,\,\,0 \le j \le n_y -1
Tensor-product spline interpolants in two dimensions can be computed quite efficiently by solving (repeatedly) two univariate interpolation problems.

The computation is motivated by the following observations. It is necessary to solve the system of equations

\sum_{m=0}^{n_y - 1} \sum_{n=0}^{n_x-1} c_{nm}B_{n,k_x,t_x}(x_i) B_{m,k_y,t_y}(y_j) = f_{ij}
Setting
h_{mi} = \sum_{n=0}^{n_x-1} c_{nm}B_{n,k_x,t_x}(x_i)
note that for each fixed i from 0 to n_x - 1, we have n_y linear equations in the same number of unknowns as can be seen below:
\sum_{m=0}^{n_y - 1} h_{mi}B_{n,k_y,t_y}(y_j) = f_{ij}
\sum_{m=0}^{n_y - 1} \sum_{n=0}^{n_x-1} c_{nm}B_{n,k_x,t_x}(x_i) B_{m,k_y,t_y}(y_j) = f_{ij}
Setting
h_{mi} = \sum_{n=0}^{n_x-1} c_{nm}B_{n,k_x,t_x}(x_i)
note that for each fixed i from 0 to n_x - 1, we have n_y - 1 linear equations in the same number of unknowns as can be seen below:
\sum_{m=0}^{n_y - 1} h_{mi}B_{m,k_y,t_y}(y_j) = f_{ij}
The same matrix appears in all of the equations above:
\bigl[ B_{m,k_y,t_y}(y_j)\bigr]\,\,\,\,\,\,\,\,\,\,\, 0 \le m,j \le n_y - 1
Thus, only factor this matrix once and then apply this factorization to the n_x right-hand sides. Once this is done and h_{mi} is computed, then solve for the coefficients c_{nm} using the relation
\sum_{n=0}^{n_x-1} c_{nm}B_{n,k_x,t_x}(x_i) = h_{mi}
for n from 0 to n_y - 1, which again involves one factorization and n_y solutions to the different right-hand sides. The class Spline2DInterpolate is based on the routine SPLI2D by de Boor (1978, p. 347).

See Also