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 distribution
  • result_type min () const β€” gives you the greatest lower bound value of the distribution
  • template<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 distribution
  • void param (const param_type &__param) β€” sets the parameter set of the distribution
  • void 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 __x into the output stream __os πŸ’Œ
  • bool operator== (const negative_binomial_distribution &__d1, const negative_binomial_distribution &__d2) β€” returns true if two negative binomial distributions have the same parameters and the sequences that would be generated are equal
  • 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) β€” extracts a negative_binomial_distribution random number distribution __x from 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 🌸


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