Crates.io | rand_distr |
lib.rs | rand_distr |
version | |
source | src |
created_at | 2019-06-12 09:20:01.272484 |
updated_at | 2024-11-30 08:46:34.390458 |
description | Sampling from random number distributions |
homepage | https://rust-random.github.io/book |
repository | https://github.com/rust-random/rand |
max_upload_size | |
id | 140575 |
Cargo.toml error: | TOML parse error at line 26, column 1 | 26 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Implements a full suite of random number distribution sampling routines.
This crate is a superset of the rand::distr module, including support for sampling from Beta, Binomial, Cauchy, ChiSquared, Dirichlet, Exponential, FisherF, Gamma, Geometric, Hypergeometric, InverseGaussian, LogNormal, Normal, Pareto, PERT, Poisson, StudentT, Triangular and Weibull distributions. Sampling from the unit ball, unit circle, unit disc and unit sphere surfaces is also supported.
It is worth mentioning the statrs crate which provides similar functionality
along with various support functions, including PDF and CDF computation. In
contrast, this rand_distr
crate focuses on sampling from distributions.
The floating point functions from num_traits
and libm
are used to support
no_std
environments and ensure reproducibility. If the floating point
functions from std
are preferred, which may provide better accuracy and
performance but may produce different random values, the std_math
feature
can be enabled. (Note that any other crate depending on num-traits
with the
std
feature (default-enabled) will have the same effect.)
std
(enabled by default): rand_distr
implements the Error
trait for
its error types. Implies alloc
and rand/std
.alloc
(enabled by default): required for some distributions when not using
std
(in particular, Dirichlet
and WeightedAliasIndex
).std_math
: see above on portability and libmserde
: implement (de)seriaialization using serde
rand_distr
is distributed under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT, and COPYRIGHT for details.