ISpline Kernel 1D Interface
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
public interface ISplineKernel1DRemarks
This interface defines the contract for 1D interpolation kernels that can be applied along each axis in N-dimensional tensor-product grid surfaces. Kernels are used to perform dimension-reduction interpolation: the N-dimensional problem is solved by recursively applying 1D interpolation along each axis.
Contract requirements:
- Implementations must be stateless (no instance fields beyond constants) and thread-safe.
- All evaluation methods must not allocate memory (no heap allocations) and should be suitable for use in tight, high-performance loops.
- The kernel must work with non-uniform grids (variable spacing between knots).
- The spans x and f passed to evaluation methods will always have length equal to Width.
Built-in kernels: The SplineKernels class provides standard implementations:
- Linear: 2-point linear interpolation (width 2).
- CubicHermite: 4-point cubic Hermite with centered finite differences (width 4). This kernel produces the same results as the original hard-coded cubic implementation.
Custom kernels: You can implement this interface to provide custom interpolation behavior such as PCHIP (monotone cubic), higher-order splines, or domain-specific kernels. The kernel width must be fixed (cannot depend on data).
Relation to CubicSpline: The cubic Hermite kernel (CubicHermite) is a local cubic interpolation method that uses only 4 neighboring points and computes slopes via centered finite differences. It is not the same as any specific CubicSplineKind (Natural, Clamped, NotAKnot, etc.), which are global methods that solve a tridiagonal system. For tensor-product surfaces that use global cubic splines, see the specialized 2D/3D cubic surface implementations created via [!:GridSurface.CreateCubic(Vector<double>, Vector<double>, Matrix<double>)].
Properties
| Width | Gets the number of grid samples required by this kernel along one dimension. |
Methods
| Evaluate | Computes the interpolated value at the specified coordinate. |
| Evaluate | Computes the interpolated value and its first derivative with respect to the coordinate. |
| Evaluate | Computes the interpolated value and its first and second derivatives with respect to the coordinate. |