January 9th, 2012, 9:12 pm
> Is this code public domain?Sorry, Daniel, it is not.> Or would it be easy to customise the algorithm to suit current needs? It is not that hard to do. In MT19937 you extract the 624 bit state vector, apply a jump polynomial for the size of jump you wish to do, and then replace the state vector with the transformed vector. We've precomputed the jump polynomials for 2^(10000+k) where k=0,1,...,15. Given a 16 bit sequenceID, for each bit, k, which is non-zero we apply the k-th jump polynomial.So the overall procedure goes like this:1) Instantiate the base RNG with the user specified seed.2) Create a pool of K RNGs where the 0th member is the base RNG and all others are clones of the base jumped forward using sequenceIDs 1..K-1.3) Each thread has its own unique sequenceID which is used as an index into the RNG pool.
Last edited by
Jim on January 8th, 2012, 11:00 pm, edited 1 time in total.