Visible to Intel only — GUID: GUID-74CB35FE-BF1E-4357-9A05-48B49F8799E8
Visible to Intel only — GUID: GUID-74CB35FE-BF1E-4357-9A05-48B49F8799E8
svrng_new_mcg59_engine/svrng_new_mcg59_ex
Routines for allocating memory for a mcg59 engine and initializing with one or multiple seeds
svrng_engine_t svrng_new_mcg59_engine( uint32_t seed )
svrng_engine_t svrng_new_mcg59_engine_ex( int num, uint32_t *pseed )
seed |
Initial condition for the engine. |
num |
Number of initialization values for the extended routine. May be 0 ( seed set to 1 ), 1 ( seed set to pseed[0] ), or SIMD_WIDTH. |
pseed |
Pointer to an array with initialization values for the extended routine. |
The svrng_new_mcg59_engine function allocates memory for the mcg59 engine (originated from C++ 11 standard) and initializes it using one seed value. The extended version of the function, svrng_new_mcg59_engine_ex, accepts several values for complex initialization cases where the user needs to fill the whole vector state with their own constants.
Name |
Description |
---|---|
SVRNG_STATUS_ERROR_MEMORY_ALLOC |
Memory allocation failure |
SVRNG_STATUS_ERROR_BAD_PARAM1 |
Bad parameter: num |
SVRNG_STATUS_ERROR_BAD_PARAM2 |
Bad parameter: pseed |
A pointer to an initialized engine or NULL on error.
The mcg59 is a simple 64-bit multiplicative congruential pseudo-random number generator represented by formula:
xi+1 = (a*xi) mod m
multiplier a = 1313
modulus m = 259 Range: [0,MAX), where MAX = m