STD::PHILOX_ENGINE(3cxx)
π NAME π
std::philox_engine< _UIntType, __w, __n, __r, __consts > β a discrete pseudorandom number generator with weak cryptographic properties π
(and bestie, this whole page lives in manual section 3cxx, the libstdc++ corner of manpage-land β¨)
πΈ SYNOPSIS πΈ
#include <random>
β¨ Public Types β¨
using result_type
π Public Member Functions π
template<typename _Sseq> requires __is_seed_seq<_Sseq>philox_engine (_Sseq &__q)"β seed sequence constructor for philox_enginephilox_engine (result_type __value)void discard (unsigned long long __z)β discards__znumbersresult_type operator() ()β outputs a singlew-bit number and handles state advancementtemplate<typename _Sseq> requires __is_seed_seq<_Sseq>void seed (_Sseq &__q)"β seedsphilox_engineby seed sequencevoid seed (result_type __value=default_seed)void set_counter (const array< result_type, __n > &__counter)β sets the internal counter cleartext"
π¦ Static Public Member Functions π¦
static constexpr result_type max ()β The maximum value that this engine can return.static constexpr result_type min ()β The minimum value that this engine can return.
π Static Public Attributes π
static constexpr result_type default_seedstatic constexpr array< result_type, __n/2 > multipliersstatic constexpr array< result_type, __n/2 > round_constsstatic constexpr size_t round_countstatic constexpr size_t word_countstatic constexpr size_t word_size
π Friends π
template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits > & operator<< (basic_ostream< _CharT, _Traits > &__os, const philox_engine &__x)β outputs the state of the generatorbool operator== (const philox_engine &, const philox_engine &)=defaultβ compares twophilox_engineobjectstemplate<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & operator>> (basic_istream< _CharT, _Traits > &__is, philox_engine &__x)β takes input to set the state of thephilox_engineobject
π Detailed Description π
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts>
class std::philox_engine< _UIntType, __w, __n, __r, __consts >"
A discrete pseudorandom number generator with weak cryptographic properties.
Okay so the tea β: this algorithm was designed to be used for highly parallel random number generation, and it is capable of immensely long periods. It provides "Crush-resistance", denoting an ability to pass the TestU01 Suite's "Big Crush" test, demonstrating significant apparent entropy. That's a lot of tests, and it passes them. Slay π
π¨ It is not intended for cryptographic use and should not be used for such, despite being based on cryptographic primitives. Like literally do not. It said what it said. π
The typedefs philox4x32 and philox4x64 are provided as suitable defaults for most use cases, providing high-quality random numbers with reasonable performance. (main character typedefs, honestly π«Ά)
This algorithm was created by John Salmon, Mark Moraes, Ron Dror, and David Shaw as a product of D.E. Shaw Research. Legends only β¨
π§ Template Parameters π§
__wβ Word size__nβ Buffer size__rβ Rounds__constsβ Multiplication and round constant pack, ordered asM_{0}, C_{0}, M_{1}, C_{1}, ... , M_{N/2-1}, C_{N/2-1}
β Since β
C++26
πΌ Constructor & Destructor Documentation πΌ
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts> template<typename _Sseq>
requires __is_seed_seq<_Sseq>std::philox_engine< _UIntType, __w, __n,
__r, __consts >::philox_engine (_Sseq & __q) [inline], [explicit]"
seed sequence constructor for philox_engine
Parameters
__qβ the seed sequence
π Member Function Documentation π
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts> void std::philox_engine< _UIntType, __w, __n,
__r, __consts >::discard (unsigned long long __z) [inline]
discards __z numbers
Parameters
__zβ number of iterations to discard
(bye bye, numbers π«‘)
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts> constexpr result_type std::philox_engine<
_UIntType, __w, __n, __r, __consts >::max () [inline], [static],
[constexpr]
The maximum value that this engine can return.
Referenced by std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator>>, and std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::set_counter().
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts> constexpr result_type std::philox_engine<
_UIntType, __w, __n, __r, __consts >::min () [inline], [static],
[constexpr]
The minimum value that this engine can return.
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts> result_type std::philox_engine< _UIntType, __w,
__n, __r, __consts >::operator() () [inline]
outputs a single w-bit number and handles state advancement
Returns
return_type
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts>
requires __is_seed_seq<_Sseq>template<typename _Sseq>
requires __is_seed_seq<_Sseq>void std::philox_engine< _UIntType, __w,
__n, __r, __consts >::seed (_Sseq & __q)"
seeds philox_engine by seed sequence
Parameters
__qβ the seed sequence
References std::max().
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts> void std::philox_engine< _UIntType, __w, __n,
__r, __consts >::set_counter (const array< result_type, __n > &
__counter) [inline]
sets the internal counter "cleartext"
Parameters
__counterβstd::arrayof lenN
π«Ά Friends And Related Symbol Documentation π«Ά
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts> template<typename _CharT, typename _Traits>
basic_ostream< _CharT, _Traits > & operator<< (basic_ostream< _CharT,
_Traits > & __os, const philox_engine< _UIntType, __w, __n, __r,
__consts > & __x) [friend]
outputs the state of the generator
Parameters
__osβ An output stream.__xβ Aphilox_engineobject reference
Returns
the state of the Philox Engine in __os
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts> bool operator== (const philox_engine< _UIntType,
__w, __n, __r, __consts > & , const philox_engine< _UIntType, __w, __n,
__r, __consts > & ) [friend]
compares two philox_engine objects
Returns
true if the objects will produce an identical stream, false otherwise
template<typename _UIntType, size_t __w, size_t __n, size_t __r,
_UIntType... __consts> template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & operator>> (basic_istream< _CharT,
_Traits > & __is, philox_engine< _UIntType, __w, __n, __r, __consts > &
__x) [friend]
takes input to set the state of the philox_engine object
Parameters
__isβ An input stream.__xβ Aphilox_engineobject reference
Returns
philox_engine object is set with values from instream
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
okay bestie that's the whole page, no cap, every single flag and parameter and stray quote accounted for π
β¨ This lil' doc drop comes to you courtesy of libstdc++ (rendered by Doxygen, straight from the source code) and it's filed under section 3cxx β libststd::philox_eng...__r, __consts >(3cxx) if you wanna cite it in the group chat π¦ go make some enormously long periods of random numbers, you absolute icon π
π¦ where this page comes from
- ubuntu stonking: libstdc++-16-doc 16.2.0-3ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms