On 08/22/2012 03:43 PM, Ulrich Drepper wrote:
The discard member function of the mersenne_twister_engine class is
unnecessarily inefficient. It currently discard elements one-by-one.
It is possible to discard with higher granularity by discarding the
entire internal buffer. The attached patch implements this. To avoid
duplication a new internal member function is introduced which
generates a new set of bits for the internal buffer. The operator()
is changed to use it.
Great, thanks. By the way, I suspect that other discard member functions
could be also improved (nobody touched the code since the initial
implementation when all where some sort of trivial conforming
implementation)
Paolo.