The flutter shutter camera simulator
Defines | Functions
mt19937ar.c File Reference

Mersenne Twister pseudo-RNG code. More...

#include <stdio.h>
Include dependency graph for mt19937ar.c:

Go to the source code of this file.

Defines

#define MT_N   624
#define MT_M   397
#define MT_MATRIX_A   0x9908b0dfUL
#define MT_UPPER_MASK   0x80000000UL
#define MT_LOWER_MASK   0x7fffffffUL

Functions

void mt_init_genrand (unsigned long s)
 initializes the generator with a seed
double mt_genrand_res53 (void)
 generates a random number on [0,1) with 53-bit resolution

Detailed Description

Mersenne Twister pseudo-RNG code.

Author:
Makoto Matsumoto (1997 - 2002)
Takuji Nishimura (1997 - 2002)

Original code by Takuji Nishimura and Makoto Matsumoto amended to keep only the parts used.

Definition in file mt19937ar.c.


Define Documentation

#define MT_LOWER_MASK   0x7fffffffUL

least significant r bits

Definition at line 52 of file mt19937ar.c.

#define MT_M   397

Definition at line 49 of file mt19937ar.c.

#define MT_MATRIX_A   0x9908b0dfUL

constant vector a

Definition at line 50 of file mt19937ar.c.

#define MT_N   624

Definition at line 48 of file mt19937ar.c.

#define MT_UPPER_MASK   0x80000000UL

most significant w-r bits

Definition at line 51 of file mt19937ar.c.


Function Documentation

double mt_genrand_res53 ( void  )

generates a random number on [0,1) with 53-bit resolution

Definition at line 144 of file mt19937ar.c.

Here is the caller graph for this function:

void mt_init_genrand ( unsigned long  s)

initializes the generator with a seed

Definition at line 135 of file mt19937ar.c.

Here is the caller graph for this function:

 All Files Functions Variables Typedefs Defines