]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #10223 : huonw/rust/gamma, r=cmr
authorbors <bors@rust-lang.org>
Sat, 2 Nov 2013 01:36:42 +0000 (18:36 -0700)
committerbors <bors@rust-lang.org>
Sat, 2 Nov 2013 01:36:42 +0000 (18:36 -0700)
Implements the [Gamma distribution](https://en.wikipedia.org/wiki/Gamma_distribution), using the algorithm described by Marsaglia & Tsang 2000[1]. I added tests checking that the mean and variance of this implementation is as expected for a range of values of the parameters in https://github.com/huonw/random-tests/commit/5d87c00a0fb69c8fa173593714cef76ddfddb651 (they pass locally, but obviously won't even build on Travis until this is merged).

Also, moves `std::rand::distributions` to a subfolder, and performs a minor clean-up of the benchmarking (makes the number of iterations shared by the whole `std::rand` subtree).

[1]: George Marsaglia and Wai Wan Tsang. 2000. "A Simple Method for Generating Gamma Variables" *ACM Trans. Math. Softw.* 26, 3 (September 2000), 363-372. DOI:[10.1145/358407.358414](http://doi.acm.org/10.1145/358407.358414).


Trivial merge