ExtrapolationMode Enumeration

Specifies how to handle query points that fall outside the interpolation domain.

Definition

Namespace: Numerics.NET.Curves
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
C#
public enum ExtrapolationMode

Remarks

Extrapolation modes control the behavior when evaluating a grid surface at coordinates outside the grid's domain. This is distinct from GridBoundaryCondition, which controls how tensor-product splines handle stencil assembly at grid edges.

Two categories of extrapolation:

  • Global control modes (Throw, Constant, Clamp): These are handled by the grid infrastructure before interpolation. They control whether evaluation proceeds for out-of-bounds queries and what boundary coordinates to use. The interpolation method never sees the original out-of-bounds coordinates.
  • Functional extension modes (Periodic, Reflect): These are handled by the interpolation strategy itself. They define mathematical extensions of the function beyond the grid domain by transforming query coordinates, which can interact with the interpolation method (e.g., periodic cubic splines may enforce continuity at boundaries).

Default mode resolution: When Default is specified, the actual extrapolation mode is derived from the grid's GridBoundaryCondition: Periodic boundary → Periodic extrapolation, Reflect boundary → Reflect extrapolation, otherwise Throw.

Members

Default0 Use the default extrapolation mode associated with the surface, derived from its boundary condition.
Throw1 Throw an exception when a query point is outside the interpolation domain.
Constant2 Return a constant value when a query point is outside the interpolation domain.
Clamp3 Clamp coordinates to the grid boundaries. Query coordinates outside the range [x[0], x[n-1]] are clamped to the nearest boundary value.
Periodic4 Wrap coordinates periodically. The grid domain [x[0], x[n-1]] is treated as a periodic interval that repeats infinitely in both directions.
Reflect5 Reflect coordinates at the grid boundaries. The grid is mirrored at each boundary, creating a symmetric extension.

See Also