could someone provide me with a working example for the initialisation of the sobol generator with both direction numbers and primitive polynomials in FORTRAN?
I am trying to use the dir. numbers and primitive polynomials from
by following the instructions
but the random number sequence is the same no matter which direction numbers and prim. polynomials I use. Strangely enough, I don't get any error message about any problems during initialisation!
I am using a MKL version which came with fortran composer 2011.3.174.
Feedback is much appreciated.
Oleg, let me give you a more detailed explanation.
1. SOBOL QRNG is implemented so that if params array is incorrectly filled the default implementation with dimension 1 will be used.
2. soboluserdirnums.f example shows how to initialize SOBOL QRNG with a complete direction numbers table. If you'd like you provide the generator with both initial direction numbers and primitive polynomials youll need to slightly change params array filling like this:
params(1) = dm1
params(2) = VSL_USER_QRNG_INITIAL_VALUES
params(3) = IOR(VSL_USER_INIT_DIRECTION_NUMBERS, &
params(3) = IOR(params(3), VSL_QRNG_OVERRIDE_1ST_DIM_INIT)
do i = 1, dm1
params(i+3) = poly(i)
params(4 + dm1) = maxdeg
k = 5 + dm1
params(k) = vinit(i,j)
k = k + 1
nparams = 4 + dm1 + dm1*maxdeg
thanks a lot for your more detailed explanation. At first glance it looks similar to my code, but I will have a close look once I'm back to work -- the autumn cold got me.