about summary refs log tree commit diff
path: root/src/rt/sync/rust_thread.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-11-01 18:36:42 -0700
committerbors <bors@rust-lang.org>2013-11-01 18:36:42 -0700
commitc15038db0843835bb075e2b37547e22a65604b0b (patch)
tree89b00a21b8842cdf5f9b6a8804a7ecd42bac5905 /src/rt/sync/rust_thread.cpp
parent894c1f6398648c273043ca385f5185e49dccea08 (diff)
parent3c25baa540be6186bba380e4352ef5f676deb6d6 (diff)
downloadrust-c15038db0843835bb075e2b37547e22a65604b0b.tar.gz
rust-c15038db0843835bb075e2b37547e22a65604b0b.zip
auto merge of #10223 : huonw/rust/gamma, r=cmr
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).
Diffstat (limited to 'src/rt/sync/rust_thread.cpp')
0 files changed, 0 insertions, 0 deletions