Skip to main content

transpose_slice

Function transpose_slice 

Source
pub fn transpose_slice<T, const N: usize>(source: &[T]) -> Vec<[T; N]>
where T: Copy + Send + Sync,
Expand description

Transposes a slice of n elements into a matrix with N columns and n/N rows.

When concurrent feature is enabled, the slice will be transposed using multiple threads. Uses uninit_vector for ~31% speedup at 1024x1024 (benches/transpose.rs).

ยงPanics

Panics if n is not divisible by N.