std::negati...::operator()(3)

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

Hey bestie πŸ’– welcome to the std::negative_binomial_distribution::operator() page β€” it’s the C++ Standard Libary manual page std::negati...::operator()(3) (yes, the header spells it β€œLibary,” iconic πŸ™ˆ). Buckle up, it’s giving random-number generator realness ✨

πŸ’– NAME πŸ’–

std::negative_binomial_distribution::operator() β€” literally the operator() of std::negative_binomial_distribution. That’s the whole name, no cap.

✨ Synopsis ✨

Two overloads, both since C++11 πŸ‘‘:

          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 );

What do they do? They 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. The associated parameter set is not modified. Periodt.

πŸŽ€ 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. That’s the vibe check it has to pass 🫢

🌸 Return value 🌸

The generated random number. Slay.

πŸ”₯ Complexity πŸ”₯

Amortized constant number of invocations of g.operator(). So like, on average, it’s not doing the most.


That’s the whole page, bestie πŸŽ€ Source/version: http://cppreference.com, dated 2024.06.10 β€” mwah πŸ’‹

πŸ“¦ where this page comes from