std::variate_generator(3)
πΈ NAME πΈ
std::variate_generator β bestie, it's giving "random numbers but make it fancy", okay? That's literally the whole vibe.
Oh also, hi, this is the std::variate_generator(3) page from the Library Functions Manual, since we're being official about it π
β¨ SYNOPSIS β¨
π Public Types
typedef __gnu_cxx::__enable_if< is_arithmetic< result_type >::value, result_type >::__type _IsValidTypeβ the little enable-if gatekeeper, no cap, it's just sitting there making sure your type is valid β¨typedef _Dist distribution_typeβ cute lil' alias for the distribution, obsessed πtypedef _Engine engine_typeβ and here's the alias for the engine, periodt π¦typedef __detail::_Adaptor< _Engine, _Dist > engine_value_typeβ the adaptor type, iykyk π§typedef _Dist::result_type result_typeβ the type of result that comes out the other end, iconic π
π Public Member Functions
const distribution_type & distribution () constβ hands you a const reference to the distribution π«Άdistribution_type & distribution ()β same but non-const, main character energy β¨const engine_value_type & engine () constβ const reference to the engine, slayengine_value_type & engine ()β non-const engine reference, let's go πresult_type max () constβ the closed upper bound, fr frresult_type min () constβ the closed lower bound, also frtemplate<typename _Tp > result_type operator() (_Tp __value)β takes a__value, lowkey enigmatic πresult_type operator() ()β gives you the next value, the actual moment we've all been waiting for π₯variate_generator (engine_type __eng, distribution_type __dist)β the constructor, hi bestie π
π¦ Detailed Description π¦
template<typename _Engine, typename _Dist> class std::variate_generator< _Engine, _Dist >
Okay so here's the tea: this thing produces random numbers on a given distribution function using a non-uniform random number generation engine. Not uniform. Non-uniform. She's picky and we love her for it π
Todo: the engine_value_type needs to be studied more carefully. (Bestie the docs are literally admitting they don't fully get it yet and honestly? relatable π)
Definition at line 218 of file tr1_impl/random.
π Constructor & Destructor Documentation π
template<typename _Engine , typename _Dist > std::variate_generator< _Engine , _Dist >::variate_generator (engine_type __eng, distribution_type __dist) [inline]
Constructs a variate generator, and likeβ¦ it's using the uniform random number generator __eng for the random distribution __dist. So __eng feeds it, __dist shapes it, match made in heaven πΈ
Exceptions: any exceptions which may thrown by the copy constructors of the _Engine or _Dist objects. So yeah, if those copy constructors decide to act up, it's on them π
Definition at line 242 of file tr1_impl/random.
π Member Function Documentation π
template<typename _Engine , typename _Dist > const distribution_type& std::variate_generator< _Engine , _Dist >::distribution () const [inline]
Gets a const reference to the underlying random distribution. Peek but don't touch vibes π«Ά
Definition at line 287 of file tr1_impl/random.
template<typename _Engine , typename _Dist > distribution_type& std::variate_generator< _Engine , _Dist >::distribution () [inline]
Gets a reference to the underlying random distribution β this one you can touch, go off π
Definition at line 280 of file tr1_impl/random.
Referenced by std::variate_generator< _Engine , _Dist >::max(), and std::variate_generator< _Engine , _Dist >::min().
template<typename _Engine , typename _Dist > const engine_value_type& std::variate_generator< _Engine , _Dist >::engine () const [inline]
Gets a const reference to the underlying uniform random number generator object. The engine said no pictures please πΈ
Definition at line 273 of file tr1_impl/random.
template<typename _Engine , typename _Dist > engine_value_type& std::variate_generator< _Engine , _Dist >::engine () [inline]
Gets a reference to the underlying uniform random number generator object β non-const edition, so you can actually poke at it π
Definition at line 265 of file tr1_impl/random.
template<typename _Engine , typename _Dist > result_type std::variate_generator< _Engine , _Dist >::max () const [inline]
Gets the closed upper bound of the distribution interval. The ceiling, literally π
Definition at line 301 of file tr1_impl/random.
References std::variate_generator< _Engine , _Dist >::distribution().
template<typename _Engine , typename _Dist > result_type std::variate_generator< _Engine , _Dist >::min () const [inline]
Gets the closed lower bound of the distribution interval. The floor, also literally π
Definition at line 294 of file tr1_impl/random.
References std::variate_generator< _Engine , _Dist >::distribution().
template<typename _Engine , typename _Dist > template<typename _Tp > result_type std::variate_generator< _Engine , _Dist >::operator() (_Tp __value) [inline]
WTF? π That's it. That's the whole description. The documentation team truly said "no thoughts, head empty" and I respect the honesty π
Definition at line 257 of file tr1_impl/random.
template<typename _Engine , typename _Dist > result_type std::variate_generator< _Engine , _Dist >::operator() () [inline]
Gets the next generated value on the distribution. The payoff. The reveal. The moment πβ¨
Definition at line 249 of file tr1_impl/random.
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. Not a human, just a robot doing its little robot thing π€π
Okay that's the whole page bestie, you ate that π
β¨ Cute little sign-off: this was libstdc++, dated 21 Apr 2009, and the page is std::variate_generator(3) β go forth and generate some variates, icon π¦πΈ
π¦ where this page comes from
- nixpkgs unstable: std-man-pages 4.4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms