ZEDA  1.6.18
Data Structures | Macros | Functions
zeda_rand.h File Reference

random number generator. More...

#include <zeda/zeda_misc.h>
Include dependency graph for zeda_rand.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  zRandMT
 random number generator based on Mersenne twister. More...
 

Macros

#define zRandInit()   zRandInitMT( NULL )
 
#define zRandI(min, max)   zRandMTI( NULL, min, max )
 
#define zRandF(min, max)   zRandMTF( NULL, min, max )
 
#define zRandN()   zRandMTN( NULL )
 
#define zRandNU()   zRandMTNU( NULL )
 

Functions

void zRandInitMT (zRandMT *mt)
 initialize a random number generator based on Mersenne twister. More...
 
int zRandMTI (zRandMT *mt, int min, int max)
 a pseudo-random integer between min and max. More...
 
double zRandMTF (zRandMT *mt, double min, double max)
 a pseudo-random double-precision floating-point value between min and max. More...
 
double zRandMTN (zRandMT *mt)
 a pseudo-random double-precision floating-point value in the range of [0,1]. More...
 
double zRandMTNU (zRandMT *mt)
 a pseudo-random value in the range of [0,1). More...
 
zRandMTzRandMTDefault (void)
 return a pointer to the default random number generator. More...
 

Detailed Description

random number generator.

This implementation of Mersenne twister proposed by M. Matsumoto and T. Nishimura (1995) is a simple rearrangement of the code written by Mr. Isaku Wada. The original sources zmtrand.{h,c} are available at: http://www001.upp.so-net.ne.jp/isaku/index.html

Author
Zhidao