STD::GEOMETRIC_DISTRIBUTION(3)
π std::geometric_distribution< _IntType > π
okay bestie, welcome to the Library Functions Manual, section 3, and yes we are talking about std::geometric_distribution< _IntType > today. it's a whole template class and it's lowkey iconic, let's get into it π
β¨ NAME β¨
std::geometric_distribution< _IntType > β a discrete geometric random number distribution. that's it, that's the vibe. π
πΈ SYNOPSIS πΈ
#include <random>
π¦ Classes
struct param_type
π¦ Public Types
typedef _IntType result_type
π¦ Public Member Functions
geometric_distribution (const param_type &__p)geometric_distribution (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. the ceiling, bestie π«Άresult_type min () constβ returns the greatest lower bound value of the distribution. the floor, fr frtemplate<typename _UniformRandomNumberGenerator> result_type operator() (_UniformRandomNumberGenerator &__urng)β generating functions. this is the one that actually spits out numbers β¨template<typename _UniformRandomNumberGenerator> result_type operator() (_UniformRandomNumberGenerator &__urng, const param_type &__p)double p () constβ returns the distribution parameterp.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)β returntrueif two geometric distributions have the same parameters. twin check π
π 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, that's the whole math girlie. β¨
Since
C++11 β so it's been serving since 2011, no cap π
π 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 what you get back, periodt. π¦
π 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. the top of the range, bestie π«Ά
template<typename _IntType = int> result_type std::geometric_distribution< _IntType >::min () const [inline]
returns the greatest lower bound value of the distribution. the bottom of the range, slay π
template<typename _IntType = int> template<typename _UniformRandomNumberGenerator> result_type std::geometric_distribution< _IntType >::operator() (_UniformRandomNumberGenerator & __urng) [inline]
generating functions. π²
Referenced by operator()().
template<typename _IntType = int> double std::geometric_distribution< _IntType >::p () const [inline]
returns the distribution parameter p. πΈ
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.
Parameters
__paramβ the new parameter set of the distribution. give it the new vibes π
template<typename _IntType = int> void std::geometric_distribution< _IntType >::reset () [inline]
resets the distribution state. does nothing for the geometric distribution. so like, it's there, it's cute, it does absolutely nothing π not a bug, just how it is, fr fr.
π§ 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 energy π―
π Author π
generated automatically by Doxygen for libstdc++ from the source code. not me writing this by hand, it's giving robot-authored π
and that's the whole page bestie, go forth and generate those discrete geometric random numbers, you're the main character of <random> now π
this lil manual page lives under libstdc++ and the page title was std::geome... _IntType >(3) β yeah it got cut off with an ellipsis, iconic of it honestly. mwah, bye! πβ¨π
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms