STD::GEOMETRIC_DISTRIBUTION(3cxx)

✨ std::geometric_distribution< _IntType > ✨

okay bestie, so this is the libstdc++ manual page for std::geometric_distribution< _IntType > β€” a discrete geometric random number distribution, and honestly it's giving "niche but iconic" πŸ’…. This page lives in the 3cxx manual section, and we're gonna walk through every single thing on it together, no skips, no cap.


🌸 NAME 🌸

std::geometric_distribution< _IntType > β€” a discrete geometric random number distribution. like, the distribution. for geometry-adjacent randomness. she's here, she's discrete, she's random πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <random>

πŸŽ€ Classes

  • struct param_type β€” the little bundle that holds the parameters, we love a supporting character 🫢

⭐ Public Types

  • typedef _IntType result_type β€” the type of stuff she spits out

πŸ’œ Public Member Functions

  • geometric_distribution (const param_type &__p) β€” construct her from a param_type
  • geometric_distribution (double __p) β€” construct her from a raw double __p
  • template<typename _ForwardIterator , typename _UniformRandomNumberGenerator > void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng)
  • template<typename _ForwardIterator , typename _UniformRandomNumberGenerator > void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng, const param_type &__p)
  • template<typename _UniformRandomNumberGenerator > void __generate (result_type *__f, result_type *__t, _UniformRandomNumberGenerator &__urng, const param_type &__p)
  • result_type max () const β€” returns the least upper bound value of the distribution
  • result_type min () const β€” returns the greatest lower bound value of the distribution
  • template<typename _UniformRandomNumberGenerator > result_type operator() (_UniformRandomNumberGenerator &__urng) β€” generating functions, the main character herself ✨
  • template<typename _UniformRandomNumberGenerator > result_type operator() (_UniformRandomNumberGenerator &__urng, const param_type &__p) β€” the overload with a param set
  • double p () const β€” returns the distribution parameter p
  • param_type param () const β€” returns the parameter set of the distribution
  • void param (const param_type &__param) β€” sets the parameter set of the distribution
  • void reset () β€” resets the distribution state

🌈 Friends

  • bool operator== (const geometric_distribution &__d1, const geometric_distribution &__d2) β€” returns true if two geometric distributions have the same parameters, fr fr

πŸ‘‘ Detailed Description πŸ‘‘

template<typename _IntType = int>
class std::geometric_distribution< _IntType >

"A discrete geometric random number distribution." πŸ’«

The formula for the geometric probability density function is $p(i|p) = p(1 - p)^{i}$ where $p is the parameter of the distribution. like literally that's the whole vibe, that's the math, memorize it bestie 🧚

Since: C++11 β€” she's been iconic since 2011, periodt.


πŸ“ Member Typedef Documentation πŸ“

template<typename _IntType  = int> typedef _IntType std::geometric_distribution< _IntType >::result_type

The type of the range of the distribution. that's the type, that's her range, that's the whole typedef πŸŽ€


πŸ’€ Member Function Documentation πŸ’€

template<typename _IntType  = int> result_type std::geometric_distribution< _IntType >::max () const [inline]

Returns the least upper bound value of the distribution.

References std::numeric_limits< _Tp >::max().


template<typename _IntType  = int> result_type std::geometric_distribution< _IntType >::min () const [inline]

Returns the greatest lower bound value of the distribution. lowkey the smallest she can go πŸ¦‹


template<typename _IntType  = int> template<typename _UniformRandomNumberGenerator > result_type std::geometric_distribution< _IntType >::operator() (_UniformRandomNumberGenerator & __urng) [inline]

Generating functions. πŸ‘‘ this is the one you actually call.

References std::geometric_distribution< _IntType >::operator()().

Referenced by std::geometric_distribution< _IntType >::operator()(). (yes bestie, she references herself, it's giving main character energy 😭)


template<typename _IntType  = int> double std::geometric_distribution< _IntType >::p () const [inline]

Returns the distribution parameter p. just p. that's the parameter. slay πŸ’…


template<typename _IntType  = int> param_type std::geometric_distribution< _IntType >::param () const [inline]

Returns the parameter set of the distribution.

Referenced by std::operator>>().


template<typename _IntType  = int> void std::geometric_distribution< _IntType >::param (const param_type & __param) [inline]

Sets the parameter set of the distribution so now you're in control, icon behavior ✨

Parameters:

  • __param β€” The new parameter set of the distribution.

template<typename _IntType  = int> void std::geometric_distribution< _IntType >::reset () [inline]

Resets the distribution state. Does nothing for the geometric distribution. like literally nothing, she simply doesn't need it, no notes πŸ™ˆπŸ’€


template<typename _IntType  = int> bool operator== (const geometric_distribution< _IntType > & __d1, const geometric_distribution< _IntType > & __d2) [friend]

Return true if two geometric distributions have the same parameters. matching params = matching vibes, vibe check passed βœ…πŸ’œ


🌟 Author 🌟

Generated automatically by Doxygen for libstdc++ from the source code. not me getting an entire manpage auto-generated by a robot, she's efficient πŸ’–


ok that's the whole page bestie, every flag, every signature, every [inline] and [friend] β€” nothing skipped, we ate and left no crumbs πŸ“βœ¨

libstd β€” std::geometric...ion< _IntType >(3cxx) β€” that's the footer, that's the vibe, see you in the next manpage, mwah πŸŽ€πŸ’…

πŸ“¦ where this page comes from