Interval index for x value given.
import mir.ndslice.allocation: rcslice; import mir.ndslice.topology: as; import mir.ndslice.slice: sliced; import mir.interpolate.linear; static immutable x = [0.0, 1, 2]; static immutable y = [10.0, 2, 4]; auto interpolation = linear!double(x.rcslice, y.as!(const double).rcslice); assert(interpolation.findInterval(1.0) == 1);
Interval index for x value given.