HΦ
3.2.0
|
double precision SIMD-oriented Fast Mersenne Twister (dSFMT) based on IEEE 754 format. More...
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "dSFMT-params.h"
#include "wrapperMPI.h"
Go to the source code of this file.
Functions | |
static uint32_t | ini_func1 (uint32_t x) |
static uint32_t | ini_func2 (uint32_t x) |
static void | gen_rand_array_c1o2 (dsfmt_t *dsfmt, w128_t *array, int size) |
static void | gen_rand_array_c0o1 (dsfmt_t *dsfmt, w128_t *array, int size) |
static void | gen_rand_array_o0c1 (dsfmt_t *dsfmt, w128_t *array, int size) |
static void | gen_rand_array_o0o1 (dsfmt_t *dsfmt, w128_t *array, int size) |
static int | idxof (int i) |
static void | initial_mask (dsfmt_t *dsfmt) |
static void | period_certification (dsfmt_t *dsfmt) |
static void | do_recursion (w128_t *r, w128_t *a, w128_t *b, w128_t *lung) |
static void | convert_c0o1 (w128_t *w) |
static void | convert_o0c1 (w128_t *w) |
static void | convert_o0o1 (w128_t *w) |
const char * | dsfmt_get_idstring (void) |
int | dsfmt_get_min_array_size (void) |
void | dsfmt_gen_rand_all (dsfmt_t *dsfmt) |
void | dsfmt_fill_array_close1_open2 (dsfmt_t *dsfmt, double array[], int size) |
void | dsfmt_fill_array_open_close (dsfmt_t *dsfmt, double array[], int size) |
void | dsfmt_fill_array_close_open (dsfmt_t *dsfmt, double array[], int size) |
void | dsfmt_fill_array_open_open (dsfmt_t *dsfmt, double array[], int size) |
void | dsfmt_chk_init_gen_rand (dsfmt_t *dsfmt, uint32_t seed, int mexp) |
void | dsfmt_chk_init_by_array (dsfmt_t *dsfmt, uint32_t init_key[], int key_length, int mexp) |
Variables | |
dsfmt_t | dsfmt_global_data |
static const int | dsfmt_mexp = DSFMT_MEXP |
double precision SIMD-oriented Fast Mersenne Twister (dSFMT) based on IEEE 754 format.
Copyright (C) 2007,2008 Mutsuo Saito, Makoto Matsumoto and Hiroshima University. All rights reserved.
The new BSD License is applied to this software, see LICENSE.txt
Definition in file dSFMT.c.
|
inlinestatic |
This function converts the double precision floating point numbers which distribute uniformly in the range [1, 2) to those which distribute uniformly in the range [0, 1).
w | 128bit stracture of double precision floating point numbers (I/O) |
Definition at line 207 of file dSFMT.c.
Referenced by do_recursion(), and gen_rand_array_c0o1().
|
inlinestatic |
This function converts the double precision floating point numbers which distribute uniformly in the range [1, 2) to those which distribute uniformly in the range (0, 1].
w | 128bit stracture of double precision floating point numbers (I/O) |
Definition at line 218 of file dSFMT.c.
Referenced by do_recursion(), and gen_rand_array_o0c1().
|
inlinestatic |
This function converts the double precision floating point numbers which distribute uniformly in the range [1, 2) to those which distribute uniformly in the range (0, 1).
w | 128bit stracture of double precision floating point numbers (I/O) |
Definition at line 229 of file dSFMT.c.
Referenced by do_recursion(), and gen_rand_array_o0o1().
|
inlinestatic |
This function represents the recursion formula.
r | output |
a | a 128-bit part of the internal state array |
b | a 128-bit part of the internal state array |
lung | a 128-bit part of the internal state array This function represents the recursion formula. |
r | output 128-bit |
a | a 128-bit part of the internal state array |
b | a 128-bit part of the internal state array |
lung | a 128-bit part of the internal state array (I/O) |
Definition at line 154 of file dSFMT.c.
References convert_c0o1(), convert_o0c1(), and convert_o0o1().
Referenced by dsfmt_gen_rand_all(), gen_rand_array_c0o1(), gen_rand_array_c1o2(), gen_rand_array_o0c1(), gen_rand_array_o0o1(), and idxof().
void dsfmt_chk_init_by_array | ( | dsfmt_t * | dsfmt, |
uint32_t | init_key[], | ||
int | key_length, | ||
int | mexp | ||
) |
This function initializes the internal state array, with an array of 32-bit integers used as the seeds
dsfmt | dsfmt state vector. |
init_key | the array of 32-bit integers, used as a seed. |
key_length | the length of init_key. |
mexp | caller's mersenne expornent |
Definition at line 657 of file dSFMT.c.
References dsfmt_mexp, exitMPI(), idxof(), ini_func1(), ini_func2(), initial_mask(), and period_certification().
void dsfmt_chk_init_gen_rand | ( | dsfmt_t * | dsfmt, |
uint32_t | seed, | ||
int | mexp | ||
) |
This function initializes the internal state array with a 32-bit integer seed.
dsfmt | dsfmt state vector. |
seed | a 32-bit integer used as the seed. |
mexp | caller's mersenne expornent |
Definition at line 626 of file dSFMT.c.
References dsfmt_mexp, exitMPI(), idxof(), initial_mask(), and period_certification().
void dsfmt_fill_array_close1_open2 | ( | dsfmt_t * | dsfmt, |
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.
dsfmt | dsfmt state vector. |
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. |
Definition at line 556 of file dSFMT.c.
References gen_rand_array_c1o2().
void dsfmt_fill_array_close_open | ( | dsfmt_t * | dsfmt, |
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. |
dsfmt | dsfmt state vector. |
size | the number of pseudorandom numbers to be generated. see also |
Definition at line 592 of file dSFMT.c.
References gen_rand_array_c0o1().
void dsfmt_fill_array_open_close | ( | dsfmt_t * | dsfmt, |
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.
dsfmt | dsfmt state vector. |
array | an array where pseudorandom numbers are filled by this function. |
size | the number of pseudorandom numbers to be generated. see also |
Definition at line 574 of file dSFMT.c.
References gen_rand_array_o0c1().
void dsfmt_fill_array_open_open | ( | dsfmt_t * | dsfmt, |
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.
dsfmt | dsfmt state vector. |
array | an array where pseudorandom numbers are filled by this function. |
size | the number of pseudorandom numbers to be generated. see also |
Definition at line 610 of file dSFMT.c.
References gen_rand_array_o0o1().
void dsfmt_gen_rand_all | ( | dsfmt_t * | dsfmt | ) |
This function fills the internal state array with double precision floating point pseudorandom numbers of the IEEE 754 format.
dsfmt | dsfmt state vector. |
Definition at line 510 of file dSFMT.c.
References do_recursion().
const char* dsfmt_get_idstring | ( | void | ) |
int dsfmt_get_min_array_size | ( | void | ) |
|
inlinestatic |
This function fills the user-specified array with double precision floating point pseudorandom numbers of the IEEE 754 format.
dsfmt | dsfmt state vector. |
array | an 128-bit array to be filled by pseudorandom numbers. |
size | number of 128-bit pseudorandom numbers to be generated. |
Definition at line 282 of file dSFMT.c.
References convert_c0o1(), and do_recursion().
Referenced by dsfmt_fill_array_close_open().
|
inlinestatic |
This function fills the user-specified array with double precision floating point pseudorandom numbers of the IEEE 754 format.
dsfmt | dsfmt state vector. |
array | an 128-bit array to be filled by pseudorandom numbers. |
size | number of 128-bit pseudorandom numbers to be generated. |
Definition at line 244 of file dSFMT.c.
References do_recursion().
Referenced by dsfmt_fill_array_close1_open2().
|
inlinestatic |
This function fills the user-specified array with double precision floating point pseudorandom numbers of the IEEE 754 format.
dsfmt | dsfmt state vector. |
array | an 128-bit array to be filled by pseudorandom numbers. |
size | number of 128-bit pseudorandom numbers to be generated. |
Definition at line 368 of file dSFMT.c.
References convert_o0c1(), and do_recursion().
Referenced by dsfmt_fill_array_open_close().
|
inlinestatic |
This function fills the user-specified array with double precision floating point pseudorandom numbers of the IEEE 754 format.
dsfmt | dsfmt state vector. |
array | an 128-bit array to be filled by pseudorandom numbers. |
size | number of 128-bit pseudorandom numbers to be generated. |
Definition at line 325 of file dSFMT.c.
References convert_o0o1(), and do_recursion().
Referenced by dsfmt_fill_array_open_open().
|
inlinestatic |
This function simulate a 32-bit array index overlapped to 64-bit array of LITTLE ENDIAN in BIG ENDIAN machine.
Definition at line 65 of file dSFMT.c.
References do_recursion().
Referenced by dsfmt_chk_init_by_array(), and dsfmt_chk_init_gen_rand().
|
inlinestatic |
This function represents a function used in the initialization by init_by_array
x | 32-bit integer |
Definition at line 410 of file dSFMT.c.
Referenced by dsfmt_chk_init_by_array().
|
inlinestatic |
This function represents a function used in the initialization by init_by_array
x | 32-bit integer |
Definition at line 420 of file dSFMT.c.
Referenced by dsfmt_chk_init_by_array().
|
static |
This function initializes the internal state array to fit the IEEE 754 format.
dsfmt | dsfmt state vector. |
Definition at line 429 of file dSFMT.c.
Referenced by dsfmt_chk_init_by_array(), and dsfmt_chk_init_gen_rand().
|
static |
This function certificate the period of 2^{SFMT_MEXP}-1.
dsfmt | dsfmt state vector. |
Definition at line 443 of file dSFMT.c.
Referenced by dsfmt_chk_init_by_array(), and dsfmt_chk_init_gen_rand().
|
static |
dsfmt mexp for check
Definition at line 23 of file dSFMT.c.
Referenced by dsfmt_chk_init_by_array(), and dsfmt_chk_init_gen_rand().