std::piecew...:operator()(3)

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

🌸 NAME 🌸

  • std::piecew...:operator() β€” aka std::piecewise_linear_distribution::operator() πŸ’…

✨ Synopsis ✨

Okay bestie, this page lives in the C++ Standard Libary manual, and it’s all about the operator() of std::piecewise_linear_distribution πŸ¦‹. Here’s the synopsis, copied exactly so you can screenshot it and send it straight to the group chat 🫢:

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

It 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, the second version uses params πŸ‘‘. And the associated parameter set is not modified β€” no cap, it stays untouched πŸ’….

🌈 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. That’s it. That’s the tea 🫢.

⭐ Complexity ⭐

Amortized constant number of invocations of g.operator() πŸ’€.


That’s the whole page, bestie πŸ˜­πŸ’–. Source: cppreference.com Β· version/date: 2024.06.10 β€” mwah πŸ’‹ for the std::piecew...:operator()(3) page 🌟.

πŸ“¦ where this page comes from