vRngUniformBits32

Generates uniformly distributed bits in 32-bit chunks.

Syntax

FORTRAN:

status = virnguniformbits32( method, stream, n, r )

C:

status = viRngUniformBits32( method, stream, n, r );

Include Files

Input Parameters

Name

Type

Description

method

FORTRAN 77: INTEGER

Fortran 90: INTEGER, INTENT(IN)

C: const int

Generation method; the specific value is VSL_RNG_METHOD_UNIFORMBITS32_STD

stream

FORTRAN 77: INTEGER*4 stream(2)

Fortran 90: TYPE (VSL_STREAM_STATE), INTENT(IN)

C: VSLStreamStatePtr

Fortran: Descriptor of the stream state structure.

C: Pointer to the stream state structure

n

FORTRAN 77: INTEGER

Fortran 90: INTEGER, INTENT(IN)

C: const int

Number of random values to be generated

Output Parameters

Name

Type

Description

r

FORTRAN 77: INTEGER*4

Fortran 90: INTEGER (KIND=4), INTENT(OUT)

C: unsigned int*

Fortran: Vector of n 32-bit random integer numbers with uniform bit distribution.

C: Vector of n 32-bit random integer numbers with uniform bit distribution.

Description

The vRngUniformBits32 function generates uniformly distributed bits in 32-bit chunks. Unlike vRngUniformBits, which provides the output of underlying integer recurrence and does not guarantee uniform distribution across bits, vRngUniformBits32 is designed to ensure each bit in the 32-bit chunk is uniformly distributed. See VSL Notes for details.

Return Values

VSL_ERROR_OK, VSL_STATUS_OK

Indicates no error, execution is successful.

VSL_ERROR_NULL_PTR

stream is a NULL pointer.

VSL_RNG_ERROR_BAD_STREAM

stream is not a valid random stream.

VSL_RNG_ERROR_BRNG_NOT_SUPPORTED

BRNG is not supported by the function.

VSL_RNG_ERROR_NO_NUMBERS

Callback function for an abstract BRNG returns 0 as the number of updated entries in a buffer.

VSL_RNG_ERROR_QRNG_PERIOD_ELAPSED

Period of the generator has been exceeded.


Submit feedback on this help topic