335 Commits

Author SHA1 Message Date
Vinzent Steinberg
2553cb5dda rand_distr: Encourage inlining of Float methods 2019-05-15 16:18:33 +02:00
Vinzent Steinberg
90833cae31 rand_distr: Add tests for f32 sampling from Poisson 2019-05-15 16:13:57 +02:00
Vinzent Steinberg
eec9bba1e7 rand_distr: Add tests for f64 sampling from Poisson 2019-05-15 16:08:34 +02:00
Vinzent Steinberg
638b6be0a5 rand_distr: Make Poisson generic
It now supports `f32` as well.
2019-05-15 15:57:59 +02:00
Vinzent Steinberg
c03e2c8613 rand_distr: Add support for f64 to Poisson
Internally, we generate `f64`, so it makes sense to let the user access
that result directly, instead of forcing a conversion from `u64`.
2019-05-15 14:36:41 +02:00
Vinzent Steinberg
31aad1431a rand_distr: Check bounds before returning Poisson sample
Before, we might trigger undefined behaviour if the sample gets too
large.
2019-05-15 14:27:25 +02:00
Vinzent Steinberg
664dad297a rand_distr: Update binomial distribution implementation
When moving the distribution from `rand` to `rand_distr`, the changes
from #740 were missed. This commit adds those changes.
2019-05-15 14:12:36 +02:00
Diggory Hardy
b330c21001 rand_distr: fix unit circle and sphere type specifications
These are required as a side-effect of the previous generalisation.
2019-05-14 12:54:51 +01:00
Diggory Hardy
ef5961357b rand_distr: make Weibull generic over Float 2019-05-13 11:41:33 +01:00
Diggory Hardy
db795b5e97 rand_distr: make UnitCircle and UnitSphereSurface generic over Float 2019-05-13 11:38:47 +01:00
Diggory Hardy
9f13fcf86f rand_distr: make Triangular generic over Float 2019-05-13 11:30:25 +01:00
Diggory Hardy
5487157bab rand_distr: make ChiSquared, FisherF, StudentT, Beta and Pert distributions generic over Float 2019-05-11 14:38:51 +01:00
Diggory Hardy
127ba16f8e rand_distr: make Pareto generic over Float 2019-05-11 13:00:27 +01:00
Diggory Hardy
0290d42a49 rand_distr: make Dirichlet distr generic over float types 2019-05-11 12:56:55 +01:00
Diggory Hardy
49a26aa314 rand_distr: make Cauchy generic over Float type 2019-05-10 17:56:09 +01:00
Diggory Hardy
4d129e4dfb rand_distr: remove dependence on num-traits
A custom trait can be fine-tuned to our needs
2019-05-10 17:48:50 +01:00
Diggory Hardy
19829a402b impl Distribution<f32> for Gamma distribution 2019-04-27 11:46:51 +01:00
Diggory Hardy
8e3ed11cd0 impl Distribution<f32> for Exp1 and Exp 2019-04-27 08:52:17 +01:00
Diggory Hardy
59bc4d2e78 impl Distribution<N> for Normal and LogNormal
Adds dependency on num-traits
2019-04-27 08:39:37 +01:00
Diggory Hardy
09dd01445b impl Distribution<f32> for StandardNormal 2019-04-27 08:39:37 +01:00
Diggory Hardy
95c833b5aa rand_distr: add Pert distribution 2019-04-22 17:49:45 +01:00
Diggory Hardy
2946e55ef7 rand_distr::Dirichlet: rename constructor 2019-04-22 17:49:45 +01:00
Diggory Hardy
f8a7b42dd4 rand_distr::Triangular: tweaks, bench and tests 2019-04-22 17:49:31 +01:00
Diggory Hardy
48bf45253d rand_distr: notes on testing 2019-04-22 16:43:33 +01:00
Diggory Hardy
6dc6c4932b
Merge pull request #770 from vks/distr-result
rand_distr: Use `Result` instead of panics
2019-04-20 09:23:43 +01:00
Vinzent Steinberg
7b04dbd72e Remove {UnitSphereSurface, UnitCircle}::new
It is not required for zero-sized types.
2019-04-15 14:34:49 +02:00
Vinzent Steinberg
c85bb39202 rand_distr: Make error types public 2019-04-15 14:25:33 +02:00
Vinzent Steinberg
8587c23e38 rand_distr: Better treatment of nan 2019-04-10 13:43:35 +02:00
Vinzent Steinberg
466a0fcc5b LogNormal: Clarify parameter names 2019-04-10 13:30:07 +02:00
Vinzent Steinberg
09bfb4dfb2 Address review comments 2019-04-10 13:20:26 +02:00
Vinzent Steinberg
be3b21c763 rand_distr: Use Result instead of panics
This also fixes a few bugs about invalid parameters in the documentation
and the code.

Refs #581.
2019-04-09 15:10:00 +02:00
Diggory Hardy
b21713a782 Fixes 2019-03-29 14:22:44 +00:00
Diggory Hardy
aff7f2758d Address review 2019-03-29 07:46:05 +00:00
Diggory Hardy
7f8e57793a Move uniformity tests to rand_distr crate 2019-03-29 07:45:35 +00:00
Diggory Hardy
58f14da01f Add rand_distr crate
The lib.rs file has been adjusted significantly; all other
contents are copied from rand with minimal fixes.
2019-03-29 07:45:35 +00:00