The OpenD Programming Language

MetaSingleConstant

Interpolator used for non-rectiliner trapezoid-like greeds.

Constructors

this
this(T data)

Members

Functions

gridScopeView
immutable(X)[] gridScopeView()
lightConst
MetaSingleConstant lightConst()

Templates

opCall
template opCall(uint derivative = 0)

Variables

data
T data;
derivativeOrder
enum uint derivativeOrder;
dimensionCount
enum uint dimensionCount;

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