libMems/twister.c File Reference

#include <stdio.h>
#include <time.h>
#include <limits.h>
#include "twister.h"

Include dependency graph for twister.c:

Include dependency graph

Go to the source code of this file.

Defines

#define LOWER_MASK   0x7fffffffUL /* least significant r bits */
#define M   397
#define MATRIX_A   0x9908b0dfUL /* constant vector a */
#define N   624
#define UPPER_MASK   0x80000000UL /* most significant w-r bits */

Functions

unsigned long CreateTwisterSeed ()
long genrand_int31 (void)
unsigned long genrand_int32 (void)
double genrand_real1 (void)
double genrand_real2 (void)
double genrand_real3 (void)
double genrand_res53 (void)
void init_by_array (unsigned long init_key[], int key_length)
void init_genrand (unsigned long s)
double RandTwisterDouble ()
unsigned RandTwisterUnsigned ()
void SetTwisterSeed (unsigned long seed)

Variables

unsigned long mt [N]
int mti = N+1


Define Documentation

#define LOWER_MASK   0x7fffffffUL /* least significant r bits */
 

Definition at line 57 of file twister.c.

#define M   397
 

Definition at line 52 of file twister.c.

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

Definition at line 53 of file twister.c.

Referenced by genrand_int32().

#define N   624
 

Definition at line 51 of file twister.c.

Referenced by init_by_array(), and init_genrand().

#define UPPER_MASK   0x80000000UL /* most significant w-r bits */
 

Definition at line 55 of file twister.c.


Function Documentation

unsigned long CreateTwisterSeed void   ) 
 

Definition at line 186 of file twister.c.

long genrand_int31 void   ) 
 

Definition at line 147 of file twister.c.

unsigned long genrand_int32 void   ) 
 

Definition at line 109 of file twister.c.

References MATRIX_A.

double genrand_real1 void   ) 
 

Definition at line 153 of file twister.c.

double genrand_real2 void   ) 
 

Definition at line 160 of file twister.c.

double genrand_real3 void   ) 
 

Definition at line 167 of file twister.c.

double genrand_res53 void   ) 
 

Definition at line 174 of file twister.c.

void init_by_array unsigned long  init_key[],
int  key_length
 

Definition at line 83 of file twister.c.

References mt, and N.

void init_genrand unsigned long  s  ) 
 

Definition at line 64 of file twister.c.

References mt, mti, and N.

double RandTwisterDouble void   ) 
 

Definition at line 217 of file twister.c.

Referenced by mems::GenericInterval< GappedBaseImpl >::Marble().

unsigned RandTwisterUnsigned void   ) 
 

Definition at line 222 of file twister.c.

void SetTwisterSeed unsigned long  seed  ) 
 

Definition at line 181 of file twister.c.


Variable Documentation

unsigned long mt[N] [static]
 

Definition at line 60 of file twister.c.

Referenced by init_by_array(), and init_genrand().

int mti = N+1 [static]
 

Definition at line 61 of file twister.c.

Referenced by init_genrand().


Generated on Fri Mar 14 06:01:36 2008 for libMems by doxygen 1.3.6