rust-num / num-complex

Complex numbers for Rust
Apache License 2.0
232 stars 50 forks source link

Support for rand 0.5 #26

Closed cuviper closed 6 years ago

cuviper commented 6 years ago

Rand 0.5 was released today! And since we're new to rand support here, it might make sense to update before num-complex 0.2 is ever released. Rand 0.5 only supports rust 1.22+, but again since this is new functionality, and optional, that limitation may be fine. The worst case is that a user might have to use Complex::new(rng.gen(), rng.gen()) manually, as they probably do without our support.

We can potentially implement a lot of the distributions for Complex<T> based on T's own support. For many of them, we can just use T as a univariate distribution, and map it as a multivariate distribution on the real and imaginary axes. We can just stick to Standard distribution as the first step though.