packed slice
packed slice
import mir.ndslice.dynamic : transposed; auto slice = iota(3, 4, 5, 6, 7, 8, 9, 10, 11).universal; assert(slice .pack!2 .evertPack .unpack == slice.transposed!( slice.shape.length-2, slice.shape.length-1));
import mir.ndslice.iterator: SliceIterator; import mir.ndslice.slice: sliced, Slice, Universal; import mir.ndslice.allocation: slice; static assert(is(typeof( slice!int(6) .sliced(1,2,3) .pack!1 .evertPack ) == Slice!(SliceIterator!(int*, 2, Universal), 1)));
auto a = iota(3, 4, 5, 6, 7, 8, 9, 10, 11); auto b = a.pack!2.unpack; static assert(is(typeof(a.canonical) == typeof(b))); assert(a == b);
Reverses the order of dimension packs. This function is used in a functional pipeline with other selectors.