STD::NEGATIVE_BINOMIAL_DISTRIBUTION(3cxx)

🌸 NAME 🌸

std::negative_binomial_distribution< _IntType > β€” a negative_binomial_distribution random number distribution, and yes bestie it's giving main-character template energy ✨

okay so this is the 3cxx manual page for std::negative_binomial_distribution< _IntType > β€” the header line literally shows it as std::negative_...ion< _IntType >(3cxx), because even headers need a little nap sometimes πŸ’…


πŸŽ€ 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 β€” Return the $k$ parameter of the distribution.
  • 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.
  • template<typename _UniformRandomNumberGenerator > result_type operator() (_UniformRandomNumberGenerator &__urng, const param_type &__p)
  • double p () const β€” Return the $p$ parameter of the distribution.
  • 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 🌈

  • 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) β€” Return 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 >

okay so this is a negative_binomial_distribution random number distribution. The page's raw text has a couple of tiny gremlin typos here (A nenative_binomial_distribution and Thm formula), but the formula it gives 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.

  • 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.

πŸ¦‹ Member Function Documentation πŸ¦‹

  • template<typename _IntType = int> _IntType std::negative_binomial_distribution< _IntType >::k () const [inline] β€” Return 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.
    • References: std::numeric_limits< _Tp >::max().
  • template<typename _IntType = int> result_type std::negative_binomial_distribution< _IntType >::min () const [inline] β€” Returns the greatest lower bound value of the distribution.
  • template<typename _IntType > template<typename _UniformRandomNumberGenerator > negative_binomial_distribution< _IntType >::result_type std::negative_binomial_distribution< _IntType >::operator() (_UniformRandomNumberGenerator & __urng) β€” Generating functions.
  • template<typename _IntType = int> double std::negative_binomial_distribution< _IntType >::p () const [inline] β€” Return 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.
  • template<typename _IntType = int> void std::negative_binomial_distribution< _IntType >::param (const param_type & __param) [inline] β€” Sets the parameter set of the distribution.
    • 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.
    • References: std::gamma_distribution< _RealType >::reset().

  • 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.
    • 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.
  • template<typename _IntType = int> bool operator== (const negative_binomial_distribution< _IntType > & __d1, const negative_binomial_distribution< _IntType > & __d2) [friend] β€” Return true if two negative binomial distributions have the same parameters and the sequences that would be generated are equal.
  • 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.
    • 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. icons only, no cap 🫢


πŸ’– cute little sign-off bestie πŸ’– β€” source/version: libstdc++, Doxygen-generated from the source code. Footer/version string on the page: libstdstd::negative_...ion< _IntType >(3cxx). Date: the original page doesn't print one, so I'm not inventing a date, periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from