SplineKernels Class

Provides factory access to built-in 1D spline kernel implementations for tensor-product grid interpolation.

Definition

Namespace: Numerics.NET.Curves.Surfaces
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
C#
public static class SplineKernels
Inheritance
Object  →  SplineKernels

Remarks

This class serves as a registry for standard spline kernels (ISplineKernel1D) used by tensor-product grid interpolation. All built-in kernels are stateless singletons and are safe for concurrent use across threads.

Available kernels:

Kernel characteristics:

  • Local vs global: All built-in kernels are local, meaning they use only a fixed-width stencil of neighboring points. They do not require solving global systems (unlike Natural or Clamped cubic splines from CubicSpline).
  • Non-uniform grid support: All kernels work correctly with non-uniform grids (variable spacing between knots).
  • Zero allocation: All kernel evaluation methods perform no heap allocations and are suitable for high-performance tensor-product evaluation loops.

Custom kernels: Users can implement ISplineKernel1D to provide custom interpolation behavior (e.g., PCHIP for monotone-preserving cubic interpolation, quintic splines for C² continuity, or domain-specific kernels). Custom kernels can then be used via CreateTensorSpline(IReadOnlyList<IReadOnlyList<Double>>, IReadOnlyList<Double>, ISplineKernel1D, GridBoundaryCondition, ExtrapolationMode).

Relation to CubicSpline: The CubicHermite kernel is not equivalent to any CubicSplineKind. It is a local cubic method, while CubicSplineKind options (Natural, Clamped, NotAKnot) are global methods that solve tridiagonal systems. For 2D/3D surfaces built directly from CubicSpline, see the specialized 2D/3D cubic surface implementations created via [!:GridSurface.CreateCubic(Vector<double>, Vector<double>, Matrix<double>)].

Properties

CubicHermite Gets the standard 4-point cubic Hermite interpolation kernel with centered finite differences.
Linear Gets the standard 2-point linear interpolation kernel.

See Also