The OpenD Programming Language

mir_slice.select

Slice selected dimension.

struct mir_slice(Iterator_, size_t N_ = 1, SliceKind kind_ = Contiguous, Labels_...)
@trusted
select
(
size_t dimension
)
(
size_t begin
,
size_t end
)
if (
0 < N_ &&
N_ < 255
&&
!(
kind_ == Canonical &&
N_ == 1
)
&&
Labels_.length <= N_
&&
isIterator!Iterator_
)

Parameters

begin size_t

initial index of the sub-slice (inclusive)

end size_t

final index of the sub-slice (noninclusive)

Return Value

Type: auto

ndslice with length!dimension equal to end - begin.

Examples

import mir.ndslice.topology : iota;
auto sl = iota(3, 4);
assert(sl.select!1(1, 3) == sl[0 .. $, 1 .. 3]);

Meta