Wichmann-Hill BRNG Seeding

Wichmann-Hill BRNG Seeding

We are porting our application to various platforms where Intel MKL isn't available and using the NAG C Library to fill in. We noticed that both packages offer the Wichmann-Hill pseudorandom number generator, and we would like to make it so that given the same seed, the same output will be produced. However, according to the description and implementation of Wichmann-Hill on NAG, four seeds and a generator ID must be provided to initialize the stream while the VSL library uses a single seed when initializing. Thus, we can't see any immediate way of analogously seeding the two streams.

Is there a way in which, given a seed, we may produce the same output so that we can get consistent results across platforms?


2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Thank you for your question.Wichmann-Hill pseudorandom number generator requires 4 seeds for its initialization. To pass them into the library you need to use vslNewStreamEx routine. Example below demonstrates how it works:...
#define METHOD 0
#define N 1000
#define NSEED 4
...int main()
unsigned int seed[NSEED];
double r[N];
VSLStreamStatePtr stream;seed[0] = 123;
seed[1] = 124;
seed[2] = 125;
seed[3] = 126;
vslNewStreamEx( &stream, BRNG, NSEED, seed );
vdRngUniform( METHOD, stream, N, r, 0.0, 1.0 );
vslDeleteStream( &stream );
return 0;
}If for some reasons number of seeds passed into the library is less than 4 (for example, when vslNewStream function is used for the initialization of the stream) the remaining seeds are set to thedefault values. More details about initialization of the Wichmann-Hill generator can be found in the Vslnotes.pdf (http://www.intel.com/software/products/mkl/docs/vslnotes.pdf),
section Testing of Basic Random Number Generators->Basic Random Generator Properties and Testing Results->WH.

Leave a Comment

Please sign in to add a comment. Not a member? Join today