Ruby: missing/mt19937.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Enumerations | Functions
mt19937.c File Reference

Go to the source code of this file.

## Data Structures
struct | MT

## Macros
#define | N 624
#define | M 397
#define | MATRIX_A 0x9908b0dfU /* constant vector a */
#define | UMASK 0x80000000U /* most significant w-r bits */
#define | LMASK 0x7fffffffU /* least significant r bits */
#define | MIXBITS(u, v) ( ((u) & UMASK) | ((v) & LMASK) )
#define | TWIST(u, v) ((MIXBITS((u),(v)) >> 1) ^ ((v)&1U ? MATRIX_A : 0U))
#define | genrand_initialized(mt) ((mt)->next != 0)
#define | uninit_genrand(mt) ((mt)->next = 0)

## Enumerations
enum | { MT_MAX_STATE = N }

## Functions
| NO_SANITIZE ("unsigned-integer-overflow", static void init_genrand(struct MT *mt, unsigned int s))
| NO_SANITIZE ("unsigned-integer-overflow", static void init_by_array(struct MT *mt, const uint32_t init_key[], int key_length))

## Macro Definition Documentation

## ◆ genrand_initialized

#define genrand_initialized | ( |  | mt | ) | ((mt)->next != 0)

Definition at line 69 of file mt19937.c.

## ◆ LMASK

#define LMASK 0x7fffffffU /* least significant r bits */

Definition at line 56 of file mt19937.c.

## ◆ M

#define M 397

Definition at line 53 of file mt19937.c.

## ◆ MATRIX_A

#define MATRIX_A 0x9908b0dfU /* constant vector a */

Definition at line 54 of file mt19937.c.

## ◆ MIXBITS

#define MIXBITS | ( |  | u,
|  |  | v
| ) |  | ( ((u) & UMASK) | ((v) & LMASK) )

Definition at line 57 of file mt19937.c.

## ◆ N

#define N 624

Definition at line 52 of file mt19937.c.

## ◆ TWIST

#define TWIST | ( |  | u,
|  |  | v
| ) |  | ((MIXBITS((u),(v)) >> 1) ^ ((v)&1U ? MATRIX_A : 0U))

Definition at line 58 of file mt19937.c.

## ◆ UMASK

#define UMASK 0x80000000U /* most significant w-r bits */

Definition at line 55 of file mt19937.c.

## ◆ uninit_genrand

#define uninit_genrand | ( |  | mt | ) | ((mt)->next = 0)

Definition at line 70 of file mt19937.c.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
MT_MAX_STATE |

Definition at line 60 of file mt19937.c.

## Function Documentation

## ◆ NO_SANITIZE() [1/2]

NO_SANITIZE | ( | "unsigned-integer-overflow" | ,
|  | static void | init_by_arraystruct MT *mt, const uint32_t init_key[], int key_length
| ) |  |

## ◆ NO_SANITIZE() [2/2]

NO_SANITIZE | ( | "unsigned-integer-overflow" | ,
|  | static void | init_genrandstruct MT *mt, unsigned int s
| ) |  |