std::normal...:operator()(3)

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

πŸŽ€ std::normal_distribution::operator() β€” C++ Standard Libary page πŸŽ€

okay so we're on the std::normal...:operator()(3) page, and the manual name is C++ Standard Libary β€” yes, that spelling, iykyk πŸ’…. this is the call-operator page for std::normal_distribution, and it's giving overloaded, since-C++11, random-number-realness ✨

✨ NAME ✨

std::normal_distribution::operator() - std::normal_distribution::operator()

🌈 Synopsis 🌈

two overloads, both marked (since C++11), both absolute icons:

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

these calls generate random numbers that are distributed according to the associated probability function. the entropy is acquired by calling g.operator() β€” that's the whole vibe πŸ”₯

the first version uses the associated parameter set, the second version uses params. and bestie, the associated parameter set is not modified β€” she stays exactly as she is, 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 rule, bestie

⭐ Return value ⭐

the generated random number. that's it, that's the tea πŸ«–

πŸ”₯ Complexity πŸ”₯

amortized constant number of invocations of g.operator(). lowkey efficient, no cap 🧚


that's the whole page, bestie 🫢 β€” source: http://cppreference.com, version/date: 2024.06.10, and the footer title is std::normal...:operator()(3). mwah πŸ’‹

πŸ“¦ where this page comes from