Closed razorheadfx closed 6 years ago
It looks like you could just cast an &[Complex32]
to an &[f32]
and process it with a strided iterator, because the struct is repr(C)
. Are there any things you are unable to do with that approach?
Something akin to this should work:
let (a, bi) = slice::from_raw_parts(&complexes as *const Complex32 as *const f32, complexes.len())
.stride_two(/* default value here */);
a.simd_map(|| ...)
bi.simd_map(|| ...)
Thanks, I'll give it a shot!
Update: Worked nicely!
First of all thanks for making this library, the API looks really neat. I'm currently working on a project where I need to crunch a lot of complex numbers (esp. Complex ) and would love to use faster instead of hooking into external C libraries like VOLK.
Is support for complex types on your roadmap?