> Now only missing seeding for std::mt19937_64. > > This seems most complicated. > Apparently it is in > https://gcc.gnu.org/viewcvs/gcc/trunk/libstdc%2B%2B-v3/include/bits/random.tcc?revision=246542&view=markup > > Lines 346 - 389. > > I would guess that this functionality is most specialised, and most likely to be different > for different compilers. > > Really a pitty that this was not standardised. > The code at Lines 346 - 389 for the seed-member of the mersenne_twister_engine doesn't look too bad except of two aspects: What is - __detail::_Shift ? - __detail::__mod ? It seems that apart from these functions, everything else is just arithmetic of bit-logic. And the creation of that sequence in Line 360: __q.generate(__arr + 0, __arr + __n * __k); actually seems to be defined by the standard, so that can be used. ACTUALLY, I just realise that even if I can code the above myself, I couldn't use the Mersenne twister from the standard library, since apparently the only way of setting the internal state is by *constants*?? All what there is seems to be http://www.cplusplus.com/reference/random/mersenne_twister_engine/ template <class 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 mersenne_twister_engine; and that has the state, which is set by the seed-member-function, only as template parameter. So I need to implement the Mersenne twister apparently myself. Or perhaps I don't understand that yet properly. Perhaps the seed function has nothing to do with those template parameters, which are the parameters of the engine, while the seed sets only the "internal state", and that perhaps can be done explicitly by calling some std-library facility? Would be thankfor for any help. Oliver