ISplineKernel1D Interface

Represents a 1D spline kernel used by tensor-product grid interpolants.

Definition

Namespace: Numerics.NET.Curves.Surfaces
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
C#
public interface ISplineKernel1D

Remarks

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.
EvaluateWithDerivative Computes the interpolated value and its first derivative with respect to the coordinate.
EvaluateWithDerivatives Computes the interpolated value and its first and second derivatives with respect to the coordinate.

See Also