The OpenD Programming Language

metaSingleConstant

Interpolator used for non-rectiliner trapezoid-like greeds.

metaSingleConstant
(
T
)
()

Parameters

data T

rc-array of interpolator-like structures

Examples

Ignores the first dimension parameter

import mir.interpolate.linear;

auto x = [0.0, 1, 2, 3, 5];
auto y = [4.0, 0, 9, 23, 40];

auto g = [7.0, 10, 15];

import mir.ndslice.allocation: rcslice;

auto d = linear!double(x.rcslice!(immutable double), y.rcslice!(const double));

auto ignoresFirstDim = d.metaSingleConstant;

assert(ignoresFirstDim(9.0, 1.8) == d(1.8));
assert(ignoresFirstDim.opCall!1(9.0, 1.8) == [d.opCall!1(1.8), [0.0, 0.0]]);

Meta