NIEDERREITER
This is a 32-bit Gray code-based quasi-random number generator:


The value
c
is the right-most zero bit in n-1; x
n
is s-dimensional vector of 32-bit values. The s-dimensional vectors (calculated during random stream initialization) v
i
, i = 1,32
are called direction numbers. The vector u
n
is the generator output normalized to the unit hypercube (0,1)s
.According to the results of Bratley, Fox, and Niederreiter [Brat92] Niederreiter sequences have the best known theoretical asymptotic properties. VS implementation allows generating Niederreiter low-discrepancy sequences of length up to 2
32
. This implementation also allows for registration of user-defined parameters (irreducible polynomials or direction numbers), which allows obtaining quasi-random vectors of any dimension. If you do not supply user-defined parameters, the default values are used for generation of quasi-random vectors. The default dimension of quasi-random vectors can vary from 1 to 318 inclusive.Real Implementation (Single and Double Precision)
The output vector is the sequence of the floating-point values , correspond to the , and so on.
u
1
, u
2
, ..., where elements u
1
, u
2
, ..., us
correspond to the u
1
u
s+1
, u
s+2
, ..., u
2
s
u
2
Integer Implementation
The output vector of 32-bit integers , correspond to the
x
1
, x
2
, ..., where elements x
1
, x
2
, ..., xs
correspond to the x
1
x
s+1
, x
s+2
, ..., x
2
s
x
2
, and so on.Stream Initialization by Function
vslNewStream
NIEDERREITER generates the stream and initializes it specifying the input 32-bit parameter seed (dimension dimen of a quasi-random vector):
- Assumedimen= seed
- Ifdimen< 1 ordimen> 318, assumedimen= 1.
Stream Initialization by Function
vslNewStreamEx
NIEDERREITER generates the stream and initializes it specifying the array
params[]
of n
32-bit integers to set the dimension dimen
of a quasi-random vector as well as pass other generator related parameters, for example, irreducible polynomials, or direction numbers (matrix of the generator). The general interface for passing stream the polynomials via the params[]
array has the following format: Position in params[] | 0 | 1 | 2 | 3...2+dimen |
dimen | Parameter Class Indicators | Initial Values Subclass Indicators | Irreducible polynomials |
The dimension parameter params[0] is mandatory, and can be initialized as follows:
params[0] = dimen;
The other elements of params intended for passing additional user-supplied data are optional. For example, if they are not presented, then the default table of irreducible polynomials is used for generation of quasi-random vectors. VS default tables of the polynomials allow generating quasi-random sequences for dimensions up to 318.
If you want to generate quasi-random vectors of greater dimension or obtain another sequence, you can register a set of your own irreducible polynomials. In order to do this, you need to set the Parameter Class Indicators field (
params[1]
) to VSL_USER_QRNG_INITIAL_VALUES
:params[1] = VSL_USER_QRNG_INITIAL_VALUES;
Further, you should indicate in Initial Values Subclass Indicators field (
params[2]
) that you want to supply irreducible polynomials:params[2] = VSL_USER_IRRED_POLYMS;
The remainder of the params array is used to pass irreducible polynomials. They are packed as unsigned integers and serially set into corresponding positions of the params array as shown in the example below (number of the polynomials equals the dimension
dimen
):unsigned int uNiederrIrredPoly[dimen] = {...}; ... params[0] = dimen; params[1] = VSL_USER_QRNG_INITIAL_VALUES; params[2] = VSL_USER_IRRED_POLYMS; for ( i = 0; i < dimen; i++ ) params[i+3] = uNiederrIrredPoly[i];
You can also calculate direction numbers (matrix of the generator) using your own irreducible polynomials and pass this table to the generator. The interface for registration of the direction numbers is as follows:
Position in params[] | 0 | 1 | 2 | 3...dimen*32+2 |
dime n | Parameter Class Indicators | Initial Values Subclass Indicators | Direction numbers |
The dimension parameter
params[0]
and Parameter Class Indicators field ( params[1]
) can be initialized as follows:params[0] = dimen; params[1] = VSL_USER_QRNG_INITIAL_VALUES;
Further, you need to initialize Initial Values Subclass Indicators field (
params[2]
):params[2] = VSL_USER_DIRECTION_NUMBERS;
Direction numbers are assumed to be a dimen x 32 table of unsigned integers and can be passed to the generator in the following way:
unsigned int uNiederrCJ[dimen][32] = {...}; params[0] = dimen; params[1] = VSL_USER_QRNG_INITIAL_VALUES; params[2] = VSL_USER_DIRECTION_NUMBERS; k = 3; for ( i = 0; i < dimen; i++ ) { for ( j = 0; j < 32; j++ ) { params[k++] = uNiederrCJ[i][j]; } }
In short, the NIEDERREITER stream initialization is as follows:
- Ifn= 0, assumedimen= 1 and initialize the stream using the default table of irreducible polynomials.
- Ifn= 1, dimen = params[0], initialize the stream using the default table of irreducible polynomials; (if dimen < 1 or dimen > 318, assume dimen = 1).
- Ifn> 1, dimen = params[0]
- If dimen < 1, assume dimen = 1 and initialize the stream using the default table of irreducible polynomials.
- If the externally defined parameters of the generator are packed incorrectly, initialize the stream using the default table of irreducible polynomials; (if dimen > 318, assume dimen = 1).
- Initialize the NIEDERREITER quasi-random stream by means of the table of user-defined irreducible polynomials.
Subsequences Selection Methods
vslSkipAheadStream | Supported |
vslSkipAheadStreamEx | Not supported |
vslLeapfrogStream | Supported |
- The skip-ahead method skips individual components of quasi-random vectors rather than whole s-dimensional vectors. Hence, to skip N s-dimensional quasi-random vectors, callvslSkipAheadStreamsubroutine with parameternskipequal to the N s.
- The leapfrog method works with individual components of quasi-random vectors rather than with s-dimensional vectors. In addition, its functionality allows picking out a fixed quasi-random component only. In other words, nstreams parameter should be equal to the predefined constantVSL_QRNG_LEAPFROG_COMPONENTS, andkparameter should indicate the index of a component of s-dimensional quasi-random vectors to be picked out (0 ≤k<s).
Generator Period

Dimensions
1 ≤
s
≤ 318 is the default set of dimensions; user-defined dimensions are accepted.