simba icon indicating copy to clipboard operation
simba copied to clipboard

Implement `Distribution` from the `rand` crate for more types

Open GabrielDertoni opened this issue 3 years ago • 0 comments

Currently there is a feature for the optional dependency rand in the simba crate. However, only the scalar types implement the traits from rand.

I don't see a reason why the Distribution trait can't be implemented with the SIMD types for Standard, such as AutoSimd. The implementation would simply generate a random value for each of the lanes of the SIMD vector. This is pretty easy to implement since impls already exist for every type used as a SIMD element.

Implementing this would allow better integration with the rand crate which is already an optional dependency.

GabrielDertoni avatar Sep 18 '22 22:09 GabrielDertoni