Boost logo

Boost Users :

Subject: [Boost-users] [random] number of seed values required to seed engine
From: Thomas Mang (thomasmang.ng_at_[hidden])
Date: 2012-03-27 01:55:23


Hi,

Consider the mersenne_twister_engine<...> member function seeding a
engine with an iterator range of seed values:

template<typename It> void mersenne_twister_engine<...>::seed(It &, It);

Is there some nice way to figure out how many seed values this function
will need?

I have used mt19937 and had to inspect the code to figure out it needs
624. I would find it very useful if this information is somewhere
readily provided through some organized interface, e.g. a member
function or a static class member stating that value. Same for other
engine types.

BTW, I find it surprising that the first parameter is a reference to an
iterator, and hence the input argument itself will be altered. Is that
by design? If so what's the rationale? I think it's fairly odd
behaviour, giving rise to unnecessary dangerousness and should become
documented more clearly (big warning in bold flashing red letters etc. :) ).

Thanks
Thomas


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net