static array of lengths and static array of strides
Regular slice
import mir.ndslice.topology : iota; assert(iota(3, 4, 5) .structure == Structure!3([3, 4, 5], [20, 5, 1]));
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 .structure == Structure!3([9, 3, 4], [-6, 200, 50]));
Packed slice
import mir.ndslice.topology : pack, iota; assert(iota(3, 4, 5, 6, 7) .pack!2 .structure == Structure!3([3, 4, 5], [20 * 42, 5 * 42, 1 * 42]));