… | |
… | |
409 | |
409 | |
410 | // Xorshift RNGs, George Marsaglia |
410 | // Xorshift RNGs, George Marsaglia |
411 | // http://www.jstatsoft.org/v08/i14/paper |
411 | // http://www.jstatsoft.org/v08/i14/paper |
412 | // this one is about 40% faster than the tausworthe one above (i.e. not much), |
412 | // this one is about 40% faster than the tausworthe one above (i.e. not much), |
413 | // despite the inlining, and has the issue of only creating 2**32-1 numbers. |
413 | // despite the inlining, and has the issue of only creating 2**32-1 numbers. |
|
|
414 | // see also http://www.iro.umontreal.ca/~lecuyer/myftp/papers/xorshift.pdf |
414 | struct xorshift_random_generator |
415 | struct xorshift_random_generator |
415 | { |
416 | { |
416 | uint32_t x, y; |
417 | uint32_t x, y; |
417 | |
418 | |
418 | void operator =(const xorshift_random_generator &src) |
419 | void operator =(const xorshift_random_generator &src) |