Skip to content

Probability Distributions ​

ProbabilityDistributions is a collection of static helpers for drawing samples from common continuous distributions: normal (Gaussian), Cauchy, and uniform. The Nucleation module offers the same three seed diameter distributions, but draws them with the C++ standard library generators instead of these helpers.

Key Classes and Concepts ​

  • ProbabilityDistributions (static class / namespace under include/Tools/ProbabilityDistributions.h):
    • Normal (Gaussian): N(μ,σ)
    • Cauchy (Lorentzian): Cauchy(μ,γ)
    • Uniform: U[a,b]

Usage ​

Input ​

None. The distribution parameters come from the caller.

Output ​

None — pure sampling helpers.

Example ​

cpp
#include "Tools/ProbabilityDistributions.h"

// Sampling a normal distribution:
double r = ProbabilityDistributions::Normal(mu, sigma, rng);

// Uniform:
double u = ProbabilityDistributions::Uniform(rmin, rmax, rng);

(Function signatures follow whatever is declared in the header.)

Dependencies ​

  • Standard C++ <random> machinery is used internally.

Released under the GNU GPLv3 License.