tree: f89e180a239d7823d3804784a4f13a33126ba649 [path history] [tgz]
  1. benches/
  2. src/
  3. tests/
  4. Cargo.toml
  5. CHANGELOG.md
  6. COPYRIGHT
  7. LICENSE-APACHE
  8. LICENSE-MIT
  9. README.md
rand_distr/README.md

rand_distr

Test Status Latest version Book API API Minimum rustc version

Implements a full suite of random number distribution sampling routines.

This crate is a superset of the rand::distributions 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.

If the std default feature is enabled, rand_distr implements the Error trait for its error types.

The default alloc feature (which is implied by the std feature) is required for some distributions (in particular, Dirichlet and WeightedAliasIndex).

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 prefered, which may provide better accuracy and performance but may produce different random values, the std_math feature can be enabled.

Links:

License

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.