diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-01-10 08:58:39 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-02-06 14:33:05 -0500 |
commit | 9feeb4cf97d98c7b8cf3c7e871b239cea835f3f4 (patch) | |
tree | 6dccd677f3159b96d2aa75d73fd63ed8ca73c577 /src/lib/math | |
parent | 98fdc3e41a79625a5f4b51689a7c76fed4228d00 (diff) | |
download | tor-9feeb4cf97d98c7b8cf3c7e871b239cea835f3f4.tar.gz tor-9feeb4cf97d98c7b8cf3c7e871b239cea835f3f4.zip |
prob_distr: use "clang-format off" to avoid wide lines for URLs
Diffstat (limited to 'src/lib/math')
-rw-r--r-- | src/lib/math/prob_distr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/math/prob_distr.c b/src/lib/math/prob_distr.c index 548d256023..31d485120e 100644 --- a/src/lib/math/prob_distr.c +++ b/src/lib/math/prob_distr.c @@ -1284,15 +1284,16 @@ sample_genpareto_locscale(uint32_t s, double p0, double mu, double sigma, /** * Deterministically sample from the geometric distribution with * per-trial success probability p. - * + **/ +// clang-format off +/* * XXX Quantify the error (KL divergence?) of this * ceiling-of-exponential sampler from a true geometric distribution, * which we could get by rejection sampling. Relevant papers: * * John F. Monahan, `Accuracy in Random Number Generation', * Mathematics of Computation 45(172), October 1984, pp. 559--568. -*https://pdfs.semanticscholar.org/aca6/74b96da1df77b2224e8cfc5dd6d61a471632.pdf - * +https://pdfs.semanticscholar.org/aca6/74b96da1df77b2224e8cfc5dd6d61a471632.pdf * Karl Bringmann and Tobias Friedrich, `Exact and Efficient * Generation of Geometric Random Variates and Random Graphs', in * Proceedings of the 40th International Colloaquium on Automata, @@ -1301,6 +1302,7 @@ sample_genpareto_locscale(uint32_t s, double p0, double mu, double sigma, * https://doi.org/10.1007/978-3-642-39206-1_23 * https://people.mpi-inf.mpg.de/~kbringma/paper/2013ICALP-1.pdf */ +// clang-format on static double sample_geometric(uint32_t s, double p0, double p) { |