STD::NEGATIVE_BINOMIAL_DISTRIBUTION(3)
π std::negative_binomial_distribution< _IntType > π
okay bestie, real talk: you just opened a page from the Library Functions Manual and it's the one and only std::negative_binomial_distribution< _IntType > π she's a negative_binomial_distribution random number distribution and she's literally serving C++11 realness. no cap.
πΈ NAME πΈ
std::negative_binomial_distribution< _IntType > β a negative_binomial_distribution random number distribution. that's her. that's the whole vibe. π
β¨ SYNOPSIS β¨
#include <random>
π¦ Classes
struct param_type
π Public Types
typedef _IntType result_type
π Public Member Functions
negative_binomial_distribution (_IntType __k, double __p=0.5)negative_binomial_distribution (const param_type &__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)template<typename _UniformRandomNumberGenerator> void __generate (result_type *__f, result_type *__t, _UniformRandomNumberGenerator &__urng, const param_type &__p)_IntType k () constβ hands you the $k$ parameter of the distribution π«Άresult_type max () constβ gives you the least upper bound value of the distributionresult_type min () constβ gives you the greatest lower bound value of the distributiontemplate<typename _UniformRandomNumberGenerator> result_type operator() (_UniformRandomNumberGenerator &__urng)β generating functions, bb β¨template<typename _UniformRandomNumberGenerator> result_type operator() (_UniformRandomNumberGenerator &__urng, const param_type &__p)double p () constβ hands you the $p$ parameter of the distribution π«Άparam_type param () constβ gives you the parameter set of the distributionvoid param (const param_type &__param)β sets the parameter set of the distributionvoid reset ()β resets the distribution state, fresh start energy π
π Friends
template<typename _IntType1, typename _CharT, typename _Traits> std::basic_ostream< _CharT, _Traits > & operator<< (std::basic_ostream< _CharT, _Traits > &__os, const std::negative_binomial_distribution< _IntType1 > &__x)β inserts a negative_binomial_distribution random number distribution__xinto the output stream__osπbool operator== (const negative_binomial_distribution &__d1, const negative_binomial_distribution &__d2)β returnstrueif two negative binomial distributions have the same parameters and the sequences that would be generated are equaltemplate<typename _IntType1, typename _CharT, typename _Traits> std::basic_istream< _CharT, _Traits > & operator>> (std::basic_istream< _CharT, _Traits > &__is, std::negative_binomial_distribution< _IntType1 > &__x)β extracts a negative_binomial_distribution random number distribution__xfrom the input stream__isπ₯
π Detailed Description π
template<typename _IntType = int>
class std::negative_binomial_distribution< _IntType >
"A nenative_binomial_distribution random number distribution." (yes bestie, it says nenative. not me fixing it, i don't make the rules π the page is sacred.)
the formula for the negative binomial probability mass function is:
$p(i) = {} p^i (1 - p)^{t - i}$
where $t$ and $p$ are the parameters of the distribution. iconic math behaviour, fr fr. π§
Since: C++11 β
π Member Typedef Documentation π
template<typename _IntType = int>
typedef _IntType std::negative_binomial_distribution< _IntType >::result_type
the type of the range of the distribution. that's the whole assignment, periodt. π
π₯ Member Function Documentation π₯
template<typename _IntType = int>
_IntType std::negative_binomial_distribution< _IntType >::k () const [inline]
returns the $k$ parameter of the distribution. π
template<typename _IntType = int>
result_type std::negative_binomial_distribution< _IntType >::max () const [inline]
returns the least upper bound value of the distribution. the ceiling, the limit, the "that's enough" β
template<typename _IntType = int>
result_type std::negative_binomial_distribution< _IntType >::min () const [inline]
returns the greatest lower bound value of the distribution. the floor, the bare minimum, the "you must be at least this tall" π±
template<typename _IntType>
template<typename _UniformRandomNumberGenerator>
negative_binomial_distribution< _IntType >::result_type
std::negative_binomial_distribution< _IntType >::operator()
(_UniformRandomNumberGenerator & __urng)
generating functions. she generates. that's the job bestie β¨
template<typename _IntType = int>
double std::negative_binomial_distribution< _IntType >::p () const [inline]
returns the $p$ parameter of the distribution. π«Ά
template<typename _IntType = int>
param_type std::negative_binomial_distribution< _IntType >::param () const [inline]
returns the parameter set of the distribution. the whole fit, the full lewk π
template<typename _IntType = int>
void std::negative_binomial_distribution< _IntType >::param
(const param_type & __param) [inline]
sets the parameter set of the distribution. new fit, who dis π
Parameters
__paramβ the new parameter set of the distribution.
template<typename _IntType = int>
void std::negative_binomial_distribution< _IntType >::reset () [inline]
resets the distribution state. clean slate, no baggage, therapy arc complete πΈ
π¦ Friends And Related Symbol Documentation π¦
template<typename _IntType = int>
template<typename _IntType1, typename _CharT, typename _Traits>
std::basic_ostream< _CharT, _Traits > &
operator<< (std::basic_ostream< _CharT, _Traits > & __os,
const std::negative_binomial_distribution< _IntType1 > & __x) [friend]
inserts a negative_binomial_distribution random number distribution __x into the output stream __os. she's posting. she's on the feed. π€
Parameters
__osβ an output stream.__xβ a negative_binomial_distribution random number distribution.
Returns
the output stream with the state of __x inserted or in an error state. π (pray it's not the error state)
template<typename _IntType = int>
bool operator== (const negative_binomial_distribution< _IntType > & __d1,
const negative_binomial_distribution< _IntType > & __d2) [friend]
returns true if two negative binomial distributions have the same parameters and the sequences that would be generated are equal. twin flames fr fr π―
template<typename _IntType = int>
template<typename _IntType1, typename _CharT, typename _Traits>
std::basic_istream< _CharT, _Traits > &
operator>> (std::basic_istream< _CharT, _Traits > & __is,
std::negative_binomial_distribution< _IntType1 > & __x) [friend]
extracts a negative_binomial_distribution random number distribution __x from the input stream __is. she's reading the room, she's consuming content π₯
Parameters
__isβ an input stream.__xβ a negative_binomial_distribution random number generator engine.
Returns
the input stream with __x extracted or in an error state. π
π Author π
generated automatically by Doxygen for libstdc++ from the source code. the robot wrote it, i just gave it a makeover π β¨
and that's the whole page, bestie π«Ά this was the libstdc++ manual page for std::negat... _IntType >(3) β no cap, that's the title and that's the source, and she ate. go forth and generate those negative binomials responsibly. mwah πππ
π¦ 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