Tensor Spline Grid Surface Class
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
public sealed class TensorSplineGridSurface : GridSurface- Inheritance
- Object → Surface → GridSurface → TensorSplineGridSurface
Remarks
This class implements general N-dimensional interpolation on rectilinear grids using tensor-product decomposition: interpolation is performed by recursively applying a 1D spline kernel along each axis (dimension reduction). The kernel is specified via the ISplineKernel1D interface, allowing flexible interpolation methods.
Supported kernels:
- Linear: 2-point linear interpolation.
- CubicHermite: 4-point cubic Hermite with centered finite differences (Catmull-Rom style). This is the default kernel.
- Custom kernels implementing ISplineKernel1D (e.g., PCHIP, monotone cubic).
Boundary conditions: The GridBoundaryCondition parameter controls how the kernel accesses grid values during stencil assembly when the stencil extends beyond the grid bounds. Supported modes include clamp (default), periodic, reflect, and fill with a constant value.
Performance: All evaluation methods (value, gradient, Hessian) perform zero heap allocations on the hot path by using stack-allocated buffers. The tensor-product evaluation is efficient for moderate dimensions (typically up to 4-6 dimensions in practice).
Relation to specialized 2D/3D surfaces: This class provides a general implementation that works for any dimension. For 2D and 3D grids, specialized implementations (CubicGridSurface2D, CubicGridSurface3D) may offer better performance by precomputing derivatives, but they are limited to natural cubic splines and do not support custom kernels or boundary conditions.
Properties
| Dimension |
Gets the number of dimensions of the input space.
(Inherited from Surface) |
| Values |
Gets a read-only span containing the values of at the data points.
(Inherited from GridSurface) |
Methods
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| Evaluate(Double[]) |
Evaluates the surface at the specified point.
(Inherited from Surface) |
| Evaluate( |
Evaluates the surface at the specified point.
(Inherited from Surface) |
| Evaluate( |
Evaluates the surface at the specified point.
(Inherited from GridSurface) |
| Evaluate( |
Evaluates the surface at multiple points specified by a list of vectors.
(Inherited from Surface) |
| Evaluate( |
Evaluates the surface at the specified point.
(Inherited from GridSurface) |
| Evaluate( |
Evaluates the surface at multiple points specified by a read-only span of vectors.
(Inherited from Surface) |
| Evaluate( |
Evaluates the surface at multiple points stored in column-major layout.
(Inherited from Surface) |
| Evaluate | Evaluates the Hessian matrix at the specified point. |
| Get | Serves as the default hash function. (Inherited from Object) |
| Get | Gets the Type of the current instance. (Inherited from Object) |
| Gradient( |
Computes the gradient of the surface at the specified point.
(Inherited from Surface) |
| Gradient( |
Computes the gradient of a 2D surface at the specified point.
(Inherited from Surface) |
| Gradient( |
Computes the gradient of the scalar field at the specified point.
(Inherited from GridSurface) |
| Gradient( |
Computes the gradient of the surface at the specified point.
(Inherited from Surface) |
| Gradient( | (Inherited from GridSurface) |
| Gradients( |
Computes the gradients of the surface at multiple points.
(Inherited from Surface) |
| Gradients( |
Computes the gradients of the surface at multiple points.
(Inherited from Surface) |
| Hessian |
Computes the Hessian matrix of the surface at the specified point.
(Inherited from Surface) |
| ToString | Returns a string that represents the current object. (Inherited from Object) |