Constructs multivariate constant interpolant with nodes on rectilinear grid.
Interpolator used for non-rectiliner trapezoid-like greeds.
Single value interpolation
Multivariate constant interpolant with nodes on rectilinear grid.
Interpolator used for non-rectiliner trapezoid-like greeds.
Single value interpolation
import mir.ndslice; import mir.math.common: approxEqual; static immutable x = [0, 1, 2, 3]; static immutable y = [10, 20, 30, 40]; auto interpolant = constant!int(x.rcslice, y.rcslice!(const int)); assert(interpolant(-1) == 10); assert(interpolant(0) == 10); assert(interpolant(0.5) == 10); assert(interpolant(1) == 20); assert(interpolant(3) == 40); assert(interpolant(4) == 40);
2020 Ilia Ki, Kaleidic Associates Advisory Limited, Symmetry Investments
Constant Interpolation