std::gamma_...::operator()(3)

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

πŸ’– NAME πŸ’–

Okay bestie, welcome to the std::gamma_...::operator()(3) page from the C++ Standard Libary manual β€” yes, that’s β€œLibary,” we’re keeping it exactly as the header says πŸ’€βœ¨

The name is std::gamma_distribution::operator() β€” and the one-liner is literally the same thing again: std::gamma_distribution::operator() πŸ’…

✨ Synopsis ✨

Two overloads, both (since C++11), both templated on class Generator:

          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 here’s the vibe: these generate 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. The second version uses params. And super important, no cap: the associated parameter set is not modified πŸ™…β€β™€οΈ

πŸŽ€ Parameters πŸŽ€

  • g β€” a uniform random bit generator object 🎰
  • 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 πŸ’–

⭐ Complexity ⭐

  • Amortized constant number of invocations of g.operator() ⚑

Source: http://cppreference.com β€’ version/date: 2024.06.10 β€’ page: std::gamma_...::operator()(3) πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from