Graphviz 14.0.2~dev.20251008.0253
Loading...
Searching...
No Matches
randomkit.h File Reference
#include <stddef.h>
#include <util/api.h>
Include dependency graph for randomkit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rk_state_
 

Macros

#define RK_STATE_LEN   624
 
#define RK_MAX   0xFFFFFFFFUL
 

Typedefs

typedef struct rk_state_ rk_state
 

Functions

PRIVATE void rk_seed (unsigned long seed, rk_state *state)
 
PRIVATE unsigned long rk_random (rk_state *state)
 
PRIVATE unsigned long rk_interval (unsigned long max, rk_state *state)
 

Macro Definition Documentation

◆ RK_MAX

#define RK_MAX   0xFFFFFFFFUL

Definition at line 73 of file randomkit.h.

◆ RK_STATE_LEN

#define RK_STATE_LEN   624

Definition at line 62 of file randomkit.h.

Typedef Documentation

◆ rk_state

typedef struct rk_state_ rk_state

Function Documentation

◆ rk_interval()

PRIVATE 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rk_random()

PRIVATE 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().

Here is the caller graph for this function:

◆ rk_seed()

PRIVATE 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().

Here is the caller graph for this function: