std::expone...::operator()(3)

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

🌟 NAME 🌟

std::exponential_distribution::operator() β€” std::exponential_distribution::operator()

This is the C++ Standard Libary manual, section 3, bestie. Yes, it’s the call operator for std::exponential_distribution, and the NAME line literally says it twice like it’s hyping itself up πŸ’….

✨ Synopsis ✨

okay so there are two overloads, and both have been around 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 );

Overload (1) uses the associated parameter set. Overload (2) uses params instead. The associated parameter set is not modified β€” hands off, no cap 🫢.

It generates random numbers that are distributed according to the associated probability function. The entropy is acquired by calling g.operator().

πŸŽ€ 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, periodt.

🌸 Return value 🌸

The generated random number. That’s it, that’s the tea β˜•.

πŸ’– Complexity πŸ’–

Amortized constant number of invocations of g.operator(). Literally amortized constant, bestie β€” not a whole dramatic spiral.


Okay that’s the whole page, mwah πŸ’‹ β€” source: http://cppreference.com, version/date: 2024.06.10 πŸŽ€

πŸ“¦ where this page comes from