Graphviz 13.0.0~dev.20241220.2304
|
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <neatogen/randomkit.h>
Go to the source code of this file.
Macros | |
#define | N 624 |
#define | M 397 |
#define | MATRIX_A 0x9908b0dfUL |
#define | UPPER_MASK 0x80000000UL |
#define | LOWER_MASK 0x7fffffffUL |
Functions | |
void | rk_seed (unsigned long seed, rk_state *state) |
unsigned long | rk_random (rk_state *state) |
static unsigned long | rk_ulong (rk_state *state) |
returns a random unsigned long between 0 and ULONG_MAX inclusive | |
unsigned long | rk_interval (unsigned long max, rk_state *state) |
#define LOWER_MASK 0x7fffffffUL |
Definition at line 93 of file randomkit.c.
#define M 397 |
Definition at line 90 of file randomkit.c.
#define MATRIX_A 0x9908b0dfUL |
Definition at line 91 of file randomkit.c.
#define N 624 |
Definition at line 89 of file randomkit.c.
#define UPPER_MASK 0x80000000UL |
Definition at line 92 of file randomkit.c.
unsigned long rk_interval | ( | unsigned long | max, |
rk_state * | state | ||
) |
Definition at line 138 of file randomkit.c.
References rk_random(), and rk_ulong().
Referenced by fisheryates_shuffle().
unsigned long rk_random | ( | rk_state * | state | ) |
Definition at line 97 of file randomkit.c.
References rk_state_::key, LOWER_MASK, M, MATRIX_A, N, rk_state_::pos, RK_STATE_LEN, and UPPER_MASK.
Referenced by rk_interval(), and rk_ulong().
void rk_seed | ( | unsigned long | seed, |
rk_state * | state | ||
) |
Definition at line 75 of file randomkit.c.
References rk_state_::key, rk_state_::pos, RK_STATE_LEN, and seed.
Referenced by sgd().
|
static |
Definition at line 129 of file randomkit.c.
References rk_random().
Referenced by rk_interval().