STD::UNIFORM_REAL_DISTRIBUTION(3cxx)

πŸ’– NAME πŸ’–

std::uniform_real_distribution< _RealType > β€” bestie, it's the uniform continuous distribution for random numbers. That's the whole vibe. (And yes, this whole page lives in manual section 3cxx, the C++ library corner of the man-page universe πŸ¦‹)


✨ SYNOPSIS ✨

#include <random>

πŸŽ€ Classes

  • struct param_type β€” the little bundle that holds your params, iykyk.

🌸 Public Types

  • typedef _RealType result_type β€” the type of the range of the distribution.

πŸ’… Public Member Functions

  • uniform_real_distribution () β€” constructs a uniform_real_distribution object.
  • uniform_real_distribution (_RealType __a, _RealType __b=_RealType(1)) β€” constructs a uniform_real_distribution object.
  • uniform_real_distribution (const param_type &__p) β€” constructs one from a param set.
  • template<typename _ForwardIterator , typename _UniformRandomNumberGenerator > void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng) β€” the internal bulk-generator, lowkey.
  • template<typename _ForwardIterator , typename _UniformRandomNumberGenerator > void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng, const param_type &__p) β€” same thing but with a param set.
  • template<typename _UniformRandomNumberGenerator > void __generate (result_type *__f, result_type *__t, _UniformRandomNumberGenerator &__urng, const param_type &__p) β€” pointer-flavored __generate, also with params.
  • result_type a () const β€” the lower bound getter.
  • result_type b () const β€” the upper bound getter.
  • result_type max () const β€” returns the inclusive upper bound of the distribution range.
  • result_type min () const β€” returns the inclusive lower bound of the distribution range.
  • template<typename _UniformRandomNumberGenerator > result_type operator() (_UniformRandomNumberGenerator &__urng) β€” the generating functions, main character energy ✨
  • template<typename _UniformRandomNumberGenerator > result_type operator() (_UniformRandomNumberGenerator &__urng, const param_type &__p) β€” generating, but make it param-flavored.
  • 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 uniform_real_distribution &__d1, const uniform_real_distribution &__d2) β€” return true if two uniform real distributions have the same parameters.

🌈 Detailed Description 🌈

template<typename _RealType = double>
    class std::uniform_real_distribution< _RealType >

Uniform continuous distribution for random numbers. πŸ’€ No cap, that's the whole class.

A continuous random distribution on the range [min, max) with equal probability throughout the range. The URNG should be real-valued and deliver number in the range [0, 1).

Heads up bestie: the range is half-open on the top β€” [min, max) β€” and your URNG needs to be real-valued, spitting out numbers in [0, 1). Don't come at it with anything else, fr fr πŸ™ˆ

Since: C++11 πŸ‘‘


🧚 Member Typedef Documentation 🧚

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

The type of the range of the distribution. It's giving "what comes out of this thing." πŸŽ€


πŸ“ Constructor & Destructor Documentation πŸ“

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

Constructs a uniform_real_distribution object. The lower bound is set to 0.0 and the upper bound to 1.0 β€” the default girlie defaults, slay. ✨

template<typename _RealType = double> std::uniform_real_distribution< _RealType >::uniform_real_distribution (_RealType __a, _RealType __b = _RealType(1)) [inline], [explicit]

Constructs a uniform_real_distribution object.

Parameters

  • __a [IN] β€” The lower bound of the distribution.
  • __b [IN] β€” The upper bound of the distribution.
It's [explicit] β€” no sneaky implicit conversions, periodt. πŸ’…

πŸ’œ Member Function Documentation πŸ’œ

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

Returns the inclusive upper bound of the distribution range.

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

Returns the inclusive lower bound of the distribution range.

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

Generating functions. ✨

  • References std::uniform_real_distribution< _RealType >::operator()().
  • Referenced by std::uniform_real_distribution< _RealType >::operator()().
Not me pointing out that it references and is referenced by itself 😭 that's just how the docs wrote it, bestie, I'm not touching it.

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

Returns the parameter set of the distribution.

  • Referenced by std::operator>>().

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

Sets the parameter set of the distribution.

Parameters

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

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

Resets the distribution state. Does nothing for the uniform real distribution. 🫢 Literally nothing. Zero. It's a decorative reset() and honestly? Iconic.


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

Return true if two uniform real distributions have the same parameters. Matching params = matching vibes πŸ”₯


🌸 Author 🌸

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


Okurrr that's the whole page β€” every flag, param, bound and [inline] accounted for, no skips, no cap πŸ’– This cutie is page std::uniform_r...on< _RealType >(3cxx), brought to you by libstdc++ (shoutout Doxygen for generating the original, she did her little job πŸŽ€), and yes the footer really does say libstd twice in a row β€” a typo icon, we love her for it. Byeee πŸ¦‹βœ¨

πŸ“¦ where this page comes from