logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

std::mersenne_twister_engine< _UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f

Author

       Generated automatically by Doxygen for libstdc++ from the source code.

                                                    libststd::mersenne_twister_e...b,__t,__c,__l,__f>(3cxx)

Constructor & Destructor Documentation

template<typename_UIntType,size_t__w,size_t__n,size_t__m,size_t__r,_UIntType__a,size_t__u,_UIntType__d,size_t__s,_UIntType__b,size_t__t,_UIntType__c,size_t__l,_UIntType__f>template<typename_Sseq,typename=_If_seed_seq<_Sseq>>std::mersenne_twister_engine<_UIntType,__w,__n,__m,__r,__a,__u,__d,__s,__b,__t,__c,__l,__f>::mersenne_twister_engine(_Sseq&__q)[inline],[explicit]
       Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence __q.

       Parameters__q the seed sequence.

Detailed Description

template<typename_UIntType,size_t__w,size_t__n,size_t__m,size_t__r,_UIntType__a,size_t__u,_UIntType__d,size_t__s,_UIntType__b,size_t__t,_UIntType__c,size_t__l,_UIntType__f>
       class std::mersenne_twister_engine< _UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c,
       __l, __f >"A generalized feedback shift register discrete random number generator.

       This algorithm avoids multiplication and division and is designed to be friendly to a pipelined
       architecture. If the parameters are chosen correctly, this generator will produce numbers with a very
       long period and fairly good apparent entropy, although still not cryptographically strong.

       The best way to use this generator is with the predefined mt19937 class.

       This algorithm was originally invented by Makoto Matsumoto and Takuji Nishimura.

       TemplateParameters__w Word size, the number of bits in each element of the state vector.
           __n The degree of recursion.
           __m The period parameter.
           __r The separation point bit index.
           __a The last row of the twist matrix.
           __u The first right-shift tempering matrix parameter.
           __d The first right-shift tempering matrix mask.
           __s The first left-shift tempering matrix parameter.
           __b The first left-shift tempering matrix mask.
           __t The second left-shift tempering matrix parameter.
           __c The second left-shift tempering matrix mask.
           __l The second right-shift tempering matrix parameter.
           __f Initialization multiplier.

       Since
           C++11

Member Function Documentation

template<typename_UIntType,size_t__w,size_t__n,size_t__m,size_t__r,_UIntType__a,size_t__u,_UIntType__d,size_t__s,_UIntType__b,size_t__t,_UIntType__c,size_t__l,_UIntType__f>voidstd::mersenne_twister_engine<_UIntType,__w,__n,__m,__r,__a,__u,__d,__s,__b,__t,__c,__l,__f>::discard(unsignedlonglong__z)
       Discard a sequence of random numbers.

   template<typename_UIntType,size_t__w,size_t__n,size_t__m,size_t__r,_UIntType__a,size_t__u,_UIntType__d,size_t__s,_UIntType__b,size_t__t,_UIntType__c,size_t__l,_UIntType__f>staticconstexprresult_typestd::mersenne_twister_engine<_UIntType,__w,__n,__m,__r,__a,__u,__d,__s,__b,__t,__c,__l,__f>::max()[inline],[static],[constexpr]
       Gets the largest possible value in the output range.

   template<typename_UIntType,size_t__w,size_t__n,size_t__m,size_t__r,_UIntType__a,size_t__u,_UIntType__d,size_t__s,_UIntType__b,size_t__t,_UIntType__c,size_t__l,_UIntType__f>staticconstexprresult_typestd::mersenne_twister_engine<_UIntType,__w,__n,__m,__r,__a,__u,__d,__s,__b,__t,__c,__l,__f>::min()[inline],[static],[constexpr]
       Gets the smallest possible value in the output range.

Member Typedef Documentation

template<typename_UIntType,size_t__w,size_t__n,size_t__m,size_t__r,_UIntType__a,size_t__u,_UIntType__d,size_t__s,_UIntType__b,size_t__t,_UIntType__c,size_t__l,_UIntType__f>typedef_UIntTypestd::mersenne_twister_engine<_UIntType,__w,__n,__m,__r,__a,__u,__d,__s,__b,__t,__c,__l,__f>::result_type
       The type of the generated random value.

Name

       std::mersenne_twister_engine< _UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f
       >

Synopsis

       #include <random>

   PublicTypestypedef _UIntType result_typePublicMemberFunctions
       template<typename_Sseq , typename  = _If_seed_seq<_Sseq>> mersenne_twister_engine (_Sseq &__q)
           Constructs a mersenne_twister_engine random number generator engine seeded from the seed sequence
           __q.
       mersenne_twister_engine (result_type__sd)
       voiddiscard (unsigned long long __z)
           Discard a sequence of random numbers.
       result_typeoperator() ()
       template<typename_Sseq > _If_seed_seq< _Sseq > seed (_Sseq &__q)
       template<typename_Sseq > autoseed (_Sseq &__q) -> _If_seed_seq< _Sseq >
       voidseed (result_type__sd=default_seed)

   StaticPublicMemberFunctionsstatic constexpr result_typemax ()
           Gets the largest possible value in the output range.
       static constexpr result_typemin ()
           Gets the smallest possible value in the output range.

   StaticPublicAttributesstatic constexpr result_typedefault_seedstatic constexpr result_typeinitialization_multiplierstatic constexpr size_t mask_bitsstatic constexpr size_t shift_sizestatic constexpr size_t state_sizestatic constexpr result_typetempering_bstatic constexpr result_typetempering_cstatic constexpr result_typetempering_dstatic constexpr size_t tempering_lstatic constexpr size_t tempering_sstatic constexpr size_t tempering_tstatic constexpr size_t tempering_ustatic constexpr size_t word_sizestatic constexpr result_typexor_maskFriends
       template<typename_UIntType1 , size_t __w1, size_t __n1, size_t __m1, size_t __r1, _UIntType1 __a1,
           size_t __u1, _UIntType1 __d1, size_t __s1, _UIntType1 __b1, size_t __t1, _UIntType1 __c1, size_t
           __l1, _UIntType1 __f1, typename _CharT , typename _Traits > std::basic_ostream< _CharT, _Traits > &
           operator<< (std::basic_ostream< _CharT, _Traits > &__os, const std::mersenne_twister_engine<
           _UIntType1, __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1 > &__x)
           Inserts the current state of a % mersenne_twister_engine random number generator engine __x into the
           output stream __os.
       bool operator== (const mersenne_twister_engine &__lhs, const mersenne_twister_engine &__rhs)
           Compares two % mersenne_twister_engine random number generator objects of the same type for equality.
       template<typename_UIntType1 , size_t __w1, size_t __n1, size_t __m1, size_t __r1, _UIntType1 __a1,
           size_t __u1, _UIntType1 __d1, size_t __s1, _UIntType1 __b1, size_t __t1, _UIntType1 __c1, size_t
           __l1, _UIntType1 __f1, typename _CharT , typename _Traits > std::basic_istream< _CharT, _Traits > &
           operator>> (std::basic_istream< _CharT, _Traits > &__is, std::mersenne_twister_engine< _UIntType1,
           __w1, __n1, __m1, __r1, __a1, __u1, __d1, __s1, __b1, __t1, __c1, __l1, __f1 > &__x)
           Extracts the current state of a % mersenne_twister_engine random number generator engine __x from the
           input stream __is.

See Also