static array of lengths
Regular slice
import mir.ndslice.topology : iota; size_t[3] s = [20, 5, 1]; assert(iota(3, 4, 5).strides == s);
Modified regular slice
import mir.ndslice.topology : pack, iota, universal; import mir.ndslice.dynamic : reversed, strided, transposed; assert(iota(3, 4, 50) .universal .reversed!2 //makes stride negative .strided!2(6) //multiplies stride by 6 and changes corresponding length .transposed!2 //brings dimension `2` to the first position .strides == cast(ptrdiff_t[3])[-6, 200, 50]);
Packed slice
import mir.ndslice.topology : pack, iota; size_t[3] s = [20 * 42, 5 * 42, 1 * 42]; assert(iota(3, 4, 5, 6, 7) .pack!2 .strides == s);