License

.

Copyright

Copyright © 2017, Kaleidic Associates Advisory Limited

Authors

Ilya Yaroshenko

See Also:

Example

import mir.ndslice;
import mir.math.common: approxEqual;

immutable x = [0, 1, 2, 3];
immutable y = [10, 20, 30, 40];

auto interpolant = constant!int(x.sliced, y.sliced);

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);

Structs

Constant

Templates

constantReturns: