Skip to main content

hadamard

Function hadamard 

Source
pub fn hadamard(x: &mut [f32])
Expand description

The Walsh–Hadamard transform of x in place, unnormalized: for each stride h from 1 doubling to len/2, every pair (x[j], x[j+h]) of each 2h-block becomes (x[j] + x[j+h], x[j] − x[j+h]), in index order. Applied twice it is len times the identity, so len a power of two makes the inverse exact: the transform, then 2^-log2 len.