STD::EXPONENTIAL_DISTRIBUTION(3cxx)

🌸 NAME 🌸

Okay bestie, this is the (3cxx) manual page for std::exponential_distribution< _RealType > β€” literally An exponential continuous distribution for random numbers. It’s giving β€œrandom numbers with exponential distribution” energy, and we’re gonna go through every single detail together. πŸ’…βœ¨

✨ SYNOPSIS ✨

#include <random>

πŸŽ€ Classes πŸŽ€

  • struct param_type

🌼 Public Types 🌼

  • typedef _RealType result_type

πŸ’– Public Member Functions πŸ’–

  • exponential_distribution () β€” Constructs an exponential distribution with inverse scale parameter 1.0.
  • exponential_distribution (_RealType __lambda) β€” Constructs an exponential distribution with inverse scale parameter $bda$.
  • exponential_distribution (const param_type &__p) β€” the page lists this overload with no extra description, just the signature, periodt.
  • template<typename _ForwardIterator , typename _UniformRandomNumberGenerator > void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng) β€” one of the __generate overloads; the page gives the signature and no extra blurb for this one.
  • template<typename _ForwardIterator , typename _UniformRandomNumberGenerator > void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng, const param_type &__p) β€” another __generate overload, same deal: signature only on this page.
  • template<typename _UniformRandomNumberGenerator > void __generate (result_type *__f, result_type *__t, _UniformRandomNumberGenerator &__urng, const param_type &__p) β€” the pointer-flavored __generate overload; again, no extra sentence here.
  • _RealType lambda () const β€” Returns the inverse scale 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) β€” the other operator() overload, listed right there in the generating-functions gang.
  • 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 exponential_distribution &__d1, const exponential_distribution &__d2) β€” Return true if two exponential distributions have the same parameters.

🌈 Detailed Description 🌈

The class template is:

template<typename _RealType = double>
    class std::exponential_distribution< _RealType >"An exponential
    continuous distribution for random numbers.

Yes, that quote mark is literally part of the original text β€” no cap, we’re keeping it. 😭

The formula for the exponential probability density function is $p(x|bda) = bda e^{-bda x}$.

The stats line is exactly this iconic mess:

  • Mean$ac{1}{bda}$
  • Median$ac{}}bda}$
  • Mode$zero$
  • Range$[0, infty]$
  • Standard Deviation$ac{1}{bda}$

Since: C++11.

πŸ¦‹ Member Typedef Documentation πŸ¦‹

result_type

template<typename _RealType  = double> typedef _RealType
    std::exponential_distribution< _RealType >::result_type

The type of the range of the distribution.

🧚 Constructor & Destructor Documentation 🧚

πŸ—οΈ exponential_distribution ()

template<typename _RealType  = double> std::exponential_distribution<
    _RealType >::exponential_distribution () [inline]

Constructs an exponential distribution with inverse scale parameter 1.0.

πŸ—οΈ exponential_distribution (_RealType __lambda)

template<typename _RealType  = double> std::exponential_distribution<
    _RealType >::exponential_distribution (_RealType __lambda) [inline],
    [explicit]

Constructs an exponential distribution with inverse scale parameter $bda$.

πŸ”₯ Member Function Documentation πŸ”₯

lambda () const

template<typename _RealType  = double> _RealType
    std::exponential_distribution< _RealType >::lambda () const [inline]

Returns the inverse scale parameter of the distribution.

max () const

template<typename _RealType  = double> result_type
    std::exponential_distribution< _RealType >::max () const [inline]

Returns the least upper bound value of the distribution.

References std::numeric_limits< _Tp >::max().

min () const

template<typename _RealType  = double> result_type
    std::exponential_distribution< _RealType >::min () const [inline]

Returns the greatest lower bound value of the distribution.

operator() (_UniformRandomNumberGenerator & __urng)

template<typename _RealType  = double> template<typename
    _UniformRandomNumberGenerator > result_type
    std::exponential_distribution< _RealType >::operator()
    (_UniformRandomNumberGenerator & __urng) [inline]

Generating functions.

References std::exponential_distribution< _RealType >::operator()().

Referenced by std::exponential_distribution< _RealType >::operator()().

param () const

template<typename _RealType  = double> param_type
    std::exponential_distribution< _RealType >::param () const [inline]

Returns the parameter set of the distribution.

Referenced by std::operator>>().

param (const param_type & __param)

template<typename _RealType  = double> void std::exponential_distribution<
    _RealType >::param (const param_type & __param) [inline]

Sets the parameter set of the distribution.

  • Parameters: __param β€” The new parameter set of the distribution.

reset ()

template<typename _RealType  = double> void std::exponential_distribution<
    _RealType >::reset () [inline]

Resets the distribution state. Has no effect on exponential distributions.

operator==

template<typename _RealType  = double> bool operator== (const
    exponential_distribution< _RealType > & __d1, const
    exponential_distribution< _RealType > & __d2) [friend]

Return true if two exponential distributions have the same parameters.

✍️ Author ✍️

Generated automatically by Doxygen for libstdc++ from the source code.


And that’s the footer, bestie: the page signs off as libststd::exponentia...on< _RealType >(3cxx) for libstdc++, with the usual dated Doxygen-manpage-footer energy. Mwah πŸ’‹πŸ«Άβœ¨

πŸ“¦ where this page comes from