STD::PHILOX_ENGINE(3cxx)

πŸ“¦ version 16.2.0, in ubuntu stonking

πŸ’– 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_engine
  • philox_engine (result_type __value)
  • void discard (unsigned long long __z) β€” discards __z numbers
  • result_type operator() () β€” outputs a single w-bit number and handles state advancement
  • template<typename _Sseq> requires __is_seed_seq<_Sseq>void seed (_Sseq &__q)" β€” seeds philox_engine by seed sequence
  • void 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_seed
  • static constexpr array< result_type, __n/2 > multipliers
  • static constexpr array< result_type, __n/2 > round_consts
  • static constexpr size_t round_count
  • static constexpr size_t word_count
  • static 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 generator
  • bool operator== (const philox_engine &, const philox_engine &)=default β€” compares two philox_engine objects
  • template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & operator>> (basic_istream< _CharT, _Traits > &__is, philox_engine &__x) β€” takes input to set the state of the philox_engine object

πŸ”Ž 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 as M_{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::array of len N

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 β€” A philox_engine object 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 β€” A philox_engine object 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