mt19937ar.c File Reference

Mersenne Twister pseudo-RNG code. More...

#include <stdio.h>
#include "mt19937ar.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

static void init_genrand (unsigned long s)
static unsigned long genrand_int32 (void)
static double genrand_res53 (void)
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

Variables

static unsigned long mt [MT_N]
static int mti = MT_N + 1
char _mt19937ar_tag [] = "using mt19937ar " MT19937AR_VERSION

Detailed Description

Mersenne Twister pseudo-RNG code.

This is the original code by Takuji Nishimura and Makoto Matsumoto, amended to keep only the parts used. Source : http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html

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

Definition in file mt19937ar.c.


Define Documentation

#define MT_LOWER_MASK   0x7fffffffUL

least significant r bits

Definition at line 41 of file mt19937ar.c.

#define MT_M   397

Definition at line 38 of file mt19937ar.c.

#define MT_MATRIX_A   0x9908b0dfUL

constant vector a

Definition at line 39 of file mt19937ar.c.

#define MT_N   624

Definition at line 37 of file mt19937ar.c.

#define MT_UPPER_MASK   0x80000000UL

most significant w-r bits

Definition at line 40 of file mt19937ar.c.


Function Documentation

static unsigned long genrand_int32 ( void   )  [static]

generates a random number on [0,0xffffffff]-interval

Definition at line 66 of file mt19937ar.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static double genrand_res53 ( void   )  [static]

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

Definition at line 105 of file mt19937ar.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void init_genrand ( unsigned long  s  )  [static]

initializes mt[MT_N] with a seed

Definition at line 50 of file mt19937ar.c.

Here is the caller graph for this function:

double mt_genrand_res53 ( void   ) 

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

Definition at line 149 of file mt19937ar.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void mt_init_genrand ( unsigned long  s  ) 

initializes the generator with a seed

Definition at line 141 of file mt19937ar.c.

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char _mt19937ar_tag[] = "using mt19937ar " MT19937AR_VERSION

Definition at line 136 of file mt19937ar.c.

unsigned long mt[MT_N] [static]

the array for the state vector

Definition at line 43 of file mt19937ar.c.

int mti = MT_N + 1 [static]

mti==MT_N+1 means mt[MT_N] is not initialized

Definition at line 44 of file mt19937ar.c.

 All Files Functions Variables Defines
Generated on Thu Sep 1 09:57:56 2011 for non local means denoising by  doxygen 1.6.3