std::discre...:operator()(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ NAME πŸŽ€

std::discrete_distribution::operator() - std::discrete_distribution::operator()

okay bestie, this is the page for std::discrete_distribution::operator(), filed under the C++ Standard Libary manual (yes, that spelling is exactly what the page says, no cap πŸ’…). We're about to generate random numbers with the associated probability function, and the vibes are immaculate.


πŸ¦‹ Synopsis πŸ¦‹

          template< class Generator >                                       (1)
       (since C++11)
          result_type operator()( Generator& g );
          template< class Generator >                                       (2)
       (since C++11)
          result_type operator()( Generator& g, const param_type& params );

So this overload set generates random numbers that are distributed according to the associated probability function. The entropy is acquired by calling g.operator(). ✨

The first version uses the associated parameter set, and the second version uses params. The associated parameter set is not modified β€” hands off, bestie, it stays cute and untouched. 🫢

🌸 Parameters 🌸

  • g β€” a uniform random bit generator object. that's the generator, babe.
  • params β€” distribution parameter set to use instead of the associated one.

πŸ’– Type requirements πŸ’–

  • Generator must meet the requirements of UniformRandomBitGenerator.

⭐ Return value ⭐

The generated random number. that's it, that's the result, periodt.

πŸ”₯ Complexity πŸ”₯

Amortized constant number of invocations of g.operator(). iconic behavior fr fr.


mwah πŸ’‹ source/version: http://cppreference.com β€’ date: 2024.06.10 β€’ page: std::discre...:operator()(3).

πŸ“¦ where this page comes from