#include <stdio.h>
#include <inttypes.h>
Go to the source code of this file.
Defines | |
#define | inline |
#define | PRIu64 "llu" |
#define | PRIx64 "llx" |
#define | UINT64_C(v) (v ## ULL) |
Functions | |
double | genrand_close1_open2 (void) |
This function generates and returns double precision pseudorandom number which distributes uniformly in the range [1, 2). | |
static double | genrand_close_open (void) |
This function generates and returns double precision pseudorandom number which distributes uniformly in the range [0, 1). | |
static double | genrand_open_close (void) |
This function generates and returns double precision pseudorandom number which distributes uniformly in the range (0, 1]. | |
static double | genrand_open_open (void) |
This function generates and returns double precision pseudorandom number which distributes uniformly in the range (0, 1). | |
void | fill_array_open_close (double array[], int size) |
This function generates double precision floating point pseudorandom numbers which distribute in the range (0, 1] to the specified array[] by one call. | |
void | fill_array_close_open (double array[], int size) |
This function generates double precision floating point pseudorandom numbers which distribute in the range [0, 1) to the specified array[] by one call. | |
void | fill_array_open_open (double array[], int size) |
This function generates double precision floating point pseudorandom numbers which distribute in the range (0, 1) to the specified array[] by one call. | |
void | fill_array_close1_open2 (double array[], int size) |
This function generates double precision floating point pseudorandom numbers which distribute in the range [1, 2) to the specified array[] by one call. | |
char * | get_idstring (void) |
This function returns the identification string. | |
int | get_min_array_size (void) |
This function returns the minimum size of array used for fill_array functions. | |
void | init_gen_rand (uint32_t seed) |
This function initializes the internal state array with a 32-bit integer seed. | |
void | init_by_array (uint32_t init_key[], int key_length) |
This function initializes the internal state array, with an array of 32-bit integers used as the seeds. |
Makoto Matsumoto (Hiroshima University)
The new BSD License is applied to this software. see LICENSE.txt
typedef unsigned int uint32_t typedef unsigned long long uint64_t #define PRIu64 "llu" #define PRIx64 "llx"
#define inline |
#define PRIu64 "llu" |
#define PRIx64 "llx" |
#define UINT64_C | ( | v | ) | (v ## ULL) |
void fill_array_close1_open2 | ( | double | array[], | |
int | size | |||
) |
This function generates double precision floating point pseudorandom numbers which distribute in the range [1, 2) to the specified array[] by one call.
The number of pseudorandom numbers is specified by the argument size, which must be at least (SFMT_MEXP / 128) * 2 and a multiple of two. The function get_min_array_size() returns this minimum size. The generation by this function is much faster than the following fill_array_xxx functions.
For initialization, init_gen_rand() or init_by_array() must be called before the first call of this function. This function can not be used after calling genrand_xxx functions, without initialization.
array | an array where pseudorandom numbers are filled by this function. The pointer to the array must be "aligned" (namely, must be a multiple of 16) in the SIMD version, since it refers to the address of a 128-bit integer. In the standard C version, the pointer is arbitrary. | |
size | the number of 64-bit pseudorandom integers to be generated. size must be a multiple of 2, and greater than or equal to (SFMT_MEXP / 128) * 2. |
void fill_array_close_open | ( | double | array[], | |
int | size | |||
) |
This function generates double precision floating point pseudorandom numbers which distribute in the range [0, 1) to the specified array[] by one call.
This function is the same as fill_array_close1_open2() except the distribution range.
array | an array where pseudorandom numbers are filled by this function. | |
size | the number of pseudorandom numbers to be generated. see also |
void fill_array_open_close | ( | double | array[], | |
int | size | |||
) |
This function generates double precision floating point pseudorandom numbers which distribute in the range (0, 1] to the specified array[] by one call.
This function is the same as fill_array_close1_open2() except the distribution range.
array | an array where pseudorandom numbers are filled by this function. | |
size | the number of pseudorandom numbers to be generated. see also |
void fill_array_open_open | ( | double | array[], | |
int | size | |||
) |
This function generates double precision floating point pseudorandom numbers which distribute in the range (0, 1) to the specified array[] by one call.
This function is the same as fill_array_close1_open2() except the distribution range.
array | an array where pseudorandom numbers are filled by this function. | |
size | the number of pseudorandom numbers to be generated. see also |
double genrand_close1_open2 | ( | void | ) | [inline] |
This function generates and returns double precision pseudorandom number which distributes uniformly in the range [1, 2).
This is the primitive and faster than generating numbers in other ranges. init_gen_rand() or init_by_array() must be called before this function.
static double genrand_close_open | ( | void | ) | [inline, static] |
This function generates and returns double precision pseudorandom number which distributes uniformly in the range [0, 1).
init_gen_rand() or init_by_array() must be called before this function.
static double genrand_open_close | ( | void | ) | [inline, static] |
This function generates and returns double precision pseudorandom number which distributes uniformly in the range (0, 1].
init_gen_rand() or init_by_array() must be called before this function.
static double genrand_open_open | ( | void | ) | [inline, static] |
This function generates and returns double precision pseudorandom number which distributes uniformly in the range (0, 1).
init_gen_rand() or init_by_array() must be called before this function.
char* get_idstring | ( | void | ) |
This function returns the identification string.
The string shows the Mersenne exponent, and all parameters of this generator.
int get_min_array_size | ( | void | ) |
This function returns the minimum size of array used for fill_array functions.
void init_by_array | ( | uint32_t | init_key[], | |
int | key_length | |||
) |
This function initializes the internal state array, with an array of 32-bit integers used as the seeds.
init_key | the array of 32-bit integers, used as a seed. | |
key_length | the length of init_key. |
void init_gen_rand | ( | uint32_t | seed | ) |
This function initializes the internal state array with a 32-bit integer seed.
seed | a 32-bit integer used as the seed. |