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 aparam_typegeometric_distribution (double __p)β construct her from a rawdouble__ptemplate<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 distributionresult_type min () constβ returns the greatest lower bound value of the distributiontemplate<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 setdouble p () constβ returns the distribution parameterpparam_type param () constβ returns the parameter set of the distributionvoid param (const param_type &__param)β sets the parameter set of the distributionvoid reset ()β resets the distribution state
π Friends
bool operator== (const geometric_distribution &__d1, const geometric_distribution &__d2)β returnstrueif 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 ππ
π«Ά Friends And Related Symbol Documentation π«Ά
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
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms