RANDOM_GENERATORS(3)
πΈ NAME πΈ
okay bestie, welcome to Random Number Generators(3) from the Library Functions Manual β this is the whole glittery rundown of the random-number-generator classes and typedefs, no cap β¨.
π Classes π
class std::discard_block< _UniformRandomNumberGenerator, __p, __r >β the entire class signature, exactly as listed.class std::linear_congruential< _UIntType, __a, __c, __m >β a model of a linear congruential random number generator. iconic LCR behavior π .class std::random_deviceβ yes,std::random_deviceis here too.class std::xor_combine< _UniformRandomNumberGenerator1, __s1, _UniformRandomNumberGenerator2, __s2 >β the full signature, untouched.
π¦ Typedefs π¦
typedef linear_congruential< unsigned long, 48271, 0, 2147483647 > std::minstd_randtypedef linear_congruential< unsigned long, 16807, 0, 2147483647 > std::minstd_rand0typedef mersenne_twister< unsigned long, 32, 624, 397, 31, 0x9908b0dful, 11, 7, 0x9d2c5680ul, 15, 0xefc60000ul, 18 > std::mt19937typedef discard_block< subtract_with_carry< unsigned long,(1UL<< 24), 10, 24 >, 223, 24 > std::ranlux3typedef discard_block< subtract_with_carry_01< float, 24, 10, 24 >, 223, 24 > std::ranlux3_01typedef discard_block< subtract_with_carry< unsigned long,(1UL<< 24), 10, 24 >, 389, 24 > std::ranlux4typedef discard_block< subtract_with_carry_01< float, 24, 10, 24 >, 389, 24 > std::ranlux4_01typedef subtract_with_carry_01< double, 48, 5, 12 > std::ranlux64_base_01typedef subtract_with_carry_01< float, 24, 10, 24 > std::ranlux_base_01
π₯ Detailed Description π₯
These classes are the little objects that give you random or pseudorandom numbers, either from a discrete interval or a continuous one. The random number generators supplied as part of this library are all uniform random number generators, and they provide a sequence of random numbers uniformly distributed over their range. Literally the whole vibe is uniform randomness π.
A number generator is a function object with an operator() that takes zero arguments and returns a number. That's the whole function-object situation, bestie.
A compliant random number generator must satisfy the following requirements. To be documented. The requirements are called Random Number Generator Requirements. Not me making that up β that's the name in the source π.
π Typedef Documentation π
π std::minstd_rand π
typedef linear_congruential<unsigned long, 48271, 0, 2147483647> std::minstd_rand
An alternative LCR (Lehmer Generator function). Definition at line 509 of file tr1_impl/random.
π std::minstd_rand0 π
typedef linear_congruential<unsigned long, 16807, 0, 2147483647> std::minstd_rand0
The classic Minimum Standard rand0 of Lewis, Goodman, and Miller. Definition at line 504 of file tr1_impl/random.
π std::mt19937 π
typedef mersenne_twister< unsigned long, 32, 624, 397, 31, 0x9908b0dful, 11, 7, 0x9d2c5680ul, 15, 0xefc60000ul, 18 > std::mt19937
The classic Mersenne Twister.
Reference: M. Matsumoto and T. Nishimura, 'Mersenne Twister: A 623-Dimensionally Equidistributed Uniform Pseudo-Random Number Generator', ACM Transactions on Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30.
Definition at line 691 of file tr1_impl/random.
π std::ranlux3 π
typedef discard_block< subtract_with_carry<unsigned long, (1UL << 24), 10, 24>, 223, 24 > std::ranlux3
James's luxury-level-3 integer adaptation of Luescher's generator. Definition at line 1254 of file tr1_impl/random.
π std::ranlux4 π
typedef discard_block< subtract_with_carry<unsigned long, (1UL << 24), 10, 24>, 389, 24 > std::ranlux4
James's luxury-level-4 integer adaptation of Luescher's generator. Definition at line 1263 of file tr1_impl/random.
βοΈ Author βοΈ
Doxygen auto-generated this for libstdc++ from the source code. Slay, automation π
.
okay bye bestie, this page is from libstdc++, dated 21 Apr 2009 β mwah π
π¦ 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