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 auniform_real_distributionobject.uniform_real_distribution (_RealType __a, _RealType __b=_RealType(1))β constructs auniform_real_distributionobject.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)β returntrueif 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.
π Friends And Related Symbol Documentation π
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
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms