The OpenD Programming Language

subSlices

Maps index pairs to subslices.

Parameters

sliceable Sliceable

pointer, array, ndslice, series, or something sliceable with [a .. b].

slices S[]

ndslice composed of index pairs.

Return Value

Type: auto

ndslice composed of subslices.

Examples

import mir.functional: staticArray;
auto subs =[
        staticArray(2, 4),
        staticArray(2, 10),
    ];
auto sliceable = 10.iota;

auto r = sliceable.subSlices(subs);
assert(r == [
    iota([4 - 2], 2),
    iota([10 - 2], 2),
    ]);

See Also

Meta