PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | M_PI 3.14159265358979323846 |
Functions | |
static uint64 | rotl (uint64 x, int bits) |
static uint64 | xoroshiro128ss (pg_prng_state *state) |
static uint64 | splitmix64 (uint64 *state) |
void | pg_prng_seed (pg_prng_state *state, uint64 seed) |
void | pg_prng_fseed (pg_prng_state *state, double fseed) |
bool | pg_prng_seed_check (pg_prng_state *state) |
uint64 | pg_prng_uint64 (pg_prng_state *state) |
uint64 | pg_prng_uint64_range (pg_prng_state *state, uint64 rmin, uint64 rmax) |
int64 | pg_prng_int64 (pg_prng_state *state) |
int64 | pg_prng_int64p (pg_prng_state *state) |
int64 | pg_prng_int64_range (pg_prng_state *state, int64 rmin, int64 rmax) |
uint32 | pg_prng_uint32 (pg_prng_state *state) |
int32 | pg_prng_int32 (pg_prng_state *state) |
int32 | pg_prng_int32p (pg_prng_state *state) |
double | pg_prng_double (pg_prng_state *state) |
double | pg_prng_double_normal (pg_prng_state *state) |
bool | pg_prng_bool (pg_prng_state *state) |
Variables | |
pg_prng_state | pg_global_prng_state |
bool pg_prng_bool | ( | pg_prng_state * | state | ) |
Definition at line 313 of file pg_prng.c.
References xoroshiro128ss().
Referenced by gistchoose().
double pg_prng_double | ( | pg_prng_state * | state | ) |
Definition at line 268 of file pg_prng.c.
References xoroshiro128ss().
Referenced by check_log_duration(), computeIterativeZipfian(), doLog(), drandom(), explain_ExecutorStart(), geqo_rand(), get_normal_pair(), getExponentialRand(), getPoissonRand(), perform_spin_delay(), pg_prng_double_normal(), sampler_random_fract(), and StartTransaction().
double pg_prng_double_normal | ( | pg_prng_state * | state | ) |
Definition at line 290 of file pg_prng.c.
References M_PI, and pg_prng_double().
Referenced by drandom_normal(), and getGaussianRand().
void pg_prng_fseed | ( | pg_prng_state * | state, |
double | fseed | ||
) |
Definition at line 102 of file pg_prng.c.
References pg_prng_seed(), and UINT64CONST.
Referenced by geqo_set_seed(), and setseed().
int32 pg_prng_int32 | ( | pg_prng_state * | state | ) |
int32 pg_prng_int32p | ( | pg_prng_state * | state | ) |
Definition at line 254 of file pg_prng.c.
References xoroshiro128ss().
Referenced by create_and_test_bloom().
int64 pg_prng_int64 | ( | pg_prng_state * | state | ) |
Definition at line 173 of file pg_prng.c.
References xoroshiro128ss().
int64 pg_prng_int64_range | ( | pg_prng_state * | state, |
int64 | rmin, | ||
int64 | rmax | ||
) |
Definition at line 192 of file pg_prng.c.
References likely, PG_INT64_MAX, PG_INT64_MIN, pg_prng_uint64_range(), and val.
Referenced by int4random(), and int8random().
int64 pg_prng_int64p | ( | pg_prng_state * | state | ) |
Definition at line 182 of file pg_prng.c.
References UINT64CONST, and xoroshiro128ss().
void pg_prng_seed | ( | pg_prng_state * | state, |
uint64 | seed | ||
) |
Definition at line 89 of file pg_prng.c.
References pg_prng_seed_check(), and splitmix64().
Referenced by choose_dsm_implementation(), initialize_prng(), InitProcessGlobals(), initRandomState(), libpq_prng_init(), main(), permute(), pg_prng_fseed(), sampler_random_init_state(), set_random_seed(), setup_publisher(), and test_random().
bool pg_prng_seed_check | ( | pg_prng_state * | state | ) |
Definition at line 114 of file pg_prng.c.
References UINT64CONST, and unlikely.
Referenced by pg_prng_seed().
uint32 pg_prng_uint32 | ( | pg_prng_state * | state | ) |
Definition at line 227 of file pg_prng.c.
References xoroshiro128ss().
Referenced by _bt_findinsertloc(), acquire_sample_rows(), anl_init_selection_state(), anl_random_fract(), CatalogCacheCreateEntry(), choose_dsm_implementation(), dsm_create(), dsm_postmaster_startup(), ExecInitSampleScan(), generate_object_name(), InitProcessGlobals(), make_main_region_dsm_handle(), reservoir_init_selection_state(), and test_huge_distances().
uint64 pg_prng_uint64 | ( | pg_prng_state * | state | ) |
Definition at line 134 of file pg_prng.c.
References xoroshiro128ss().
Referenced by bt_check_every_level(), initRandomState(), main(), permute(), and test_random().
uint64 pg_prng_uint64_range | ( | pg_prng_state * | state, |
uint64 | rmin, | ||
uint64 | rmax | ||
) |
Definition at line 144 of file pg_prng.c.
References likely, pg_leftmost_one_pos64(), range(), val, and xoroshiro128ss().
Referenced by array_shuffle_n(), geqo_randint(), GetPermutation(), getrand(), permute(), pg_prng_int64_range(), pqConnectOptions2(), PQconnectPoll(), random_var(), SetTempTablespaces(), spgdoinsert(), test_pattern(), testdelete(), and testfindltgt().
Definition at line 72 of file pg_prng.c.
References UINT64CONST, and val.
Referenced by pg_prng_seed().
|
static |
Definition at line 54 of file pg_prng.c.
Referenced by pg_prng_bool(), pg_prng_double(), pg_prng_int32(), pg_prng_int32p(), pg_prng_int64(), pg_prng_int64p(), pg_prng_uint32(), pg_prng_uint64(), and pg_prng_uint64_range().
pg_prng_state pg_global_prng_state |
Definition at line 34 of file pg_prng.c.
Referenced by _bt_findinsertloc(), acquire_sample_rows(), anl_init_selection_state(), anl_random_fract(), array_shuffle_n(), bt_check_every_level(), CatalogCacheCreateEntry(), check_log_duration(), create_and_test_bloom(), dsm_create(), dsm_postmaster_startup(), ExecInitSampleScan(), explain_ExecutorStart(), get_normal_pair(), GetPermutation(), gistchoose(), InitProcessGlobals(), main(), make_main_region_dsm_handle(), perform_spin_delay(), prepare_buf(), reservoir_init_selection_state(), SetTempTablespaces(), spgdoinsert(), StartTransaction(), test_huge_distances(), test_pattern(), testdelete(), and testfindltgt().