Grid Boundary Condition Structure
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
public readonly struct GridBoundaryConditionRemarks
Boundary conditions control how tensor-product grid surfaces access grid values when building local interpolation stencils that extend beyond the grid extent. For example, a 4-point cubic kernel near the grid edge may require samples at indices i=-1 or i=N (outside the valid range [0, N-1]). The boundary condition determines how these out-of-range indices are mapped to valid values.
Distinction from ExtrapolationMode:
- GridBoundaryCondition (this type): Applies during construction/evaluation when the interpolation kernel needs to access grid values outside the nominal index range [0, N-1]. It affects how the stencil is assembled.
- ExtrapolationMode: Applies during query evaluation when a query coordinate falls outside the grid domain. It controls whether to throw an exception, return a fill value, clamp to boundaries, or use periodic/reflective coordinate mapping.
Usage: Boundary conditions are primarily used by tensor-product spline interpolation (via CreateCubicTensorSpline(IReadOnlyList<IReadOnlyList<Double>>, IReadOnlyList<Double>, GridBoundaryCondition, ExtrapolationMode) and CreateTensorSpline(IReadOnlyList<IReadOnlyList<Double>>, IReadOnlyList<Double>, ISplineKernel1D, GridBoundaryCondition, ExtrapolationMode)). The specialized 2D/3D cubic surfaces (created with [!:GridSurface.CreateCubic(Vector<double>, Vector<double>, Matrix<double>)]) do not use GridBoundaryCondition; their boundary behavior is determined by the CubicSplineKind used internally (always Natural in current implementation).
Available boundary conditions:
- Clamp (default): Clamp out-of-range indices to the nearest edge (repeat edge values).
- Periodic: Wrap indices periodically using modulo arithmetic (for periodic data such as angles).
- Reflect: Mirror indices at boundaries for symmetric extension (useful for even functions).
- Fill(Double): Use a constant fill value for out-of-range samples (isolates edges).
Properties
| Clamp | Gets a boundary condition that clamps out-of-range indices to the nearest edge. |
| Periodic | Gets a boundary condition that wraps indices periodically using modulo arithmetic. |
| Reflect | Gets a boundary condition that mirrors indices at the boundaries for symmetric extension. |
| Value | Gets the value used when the boundary condition is Fill(Double). Ignored for all other boundary condition types. |
Methods
| Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType) |
| Fill | Creates a boundary condition that uses a constant fill value for out-of-range samples. |
| Get | Returns the hash code for this instance. (Inherited from ValueType) |
| Get | Gets the Type of the current instance. (Inherited from Object) |
| ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType) |