Lines Matching full:distribution
12 //! This module is the home of the [`Distribution`] trait and several of its
17 //! Abstractly, a [probability distribution] describes the probability of
20 //! More concretely, an implementation of `Distribution<T>` for type `X` is an
22 //! according to the distribution `X` represents, using an external source of
25 //! A type `X` may implement `Distribution<T>` for multiple types `T`.
26 //! Any type implementing [`Distribution`] is stateless (i.e. immutable),
31 //! # The `Standard` distribution
33 //! The [`Standard`] distribution is important to mention. This is the
34 //! distribution used by [`Rng::gen`] and represents the "default" way to
39 //! Implementing `Distribution<T>` for [`Standard`] for user types `T` makes it
45 //! [`Alphanumeric`] is a simple distribution to sample random letters and
52 //! The [`Uniform`] distribution is more flexible than [`Standard`], but also
57 //! Values may be sampled from this distribution using [`Rng::sample(Range)`] or
58 //! by creating a distribution object with [`Uniform::new`],
63 //! User types `T` may also implement `Distribution<T>` for [`Uniform`],
72 //! and accuracy differ. In addition to the [`Standard`] distribution Rand offers
79 //! the [`Bernoulli`] distribution (this is used by [`Rng::gen_bool`]).
82 //! [`WeightedIndex`] distribution.
88 //! [probability distribution]: https://en.wikipedia.org/wiki/Probability_distribution
97 mod distribution; module
120 pub use self::distribution::{Distribution, DistIter, DistMap};
122 pub use self::distribution::DistString;
134 /// A generic random value distribution, implemented for many primitive types.
135 /// Usually generates values with a numerically uniform distribution, and with a
155 /// The `Standard` distribution also supports generation of the following
173 /// The [`Standard`] distribution may be implemented for user types as follows:
178 /// use rand::distributions::{Distribution, Standard};
184 /// impl Distribution<MyF32> for Standard {