3 #ifndef RANDOMGEN_DEFINED
4 #define RANDOMGEN_DEFINED 1
12 #define RANDOMGEN_N 624
16 unsigned long mt
[RANDOMGEN_N
]; // the array for the state vector
17 int mti
; // mti==N+1 means mt[N] is not initialized
18 double y2
; // guassian
19 int use_last
; // guassian
22 BASEKIT_API RandomGen
*RandomGen_new(void);
23 BASEKIT_API
void RandomGen_free(RandomGen
*self
);
25 BASEKIT_API
void RandomGen_setSeed(RandomGen
*self
, unsigned long seed
);
26 BASEKIT_API
void RandomGen_chooseRandomSeed(RandomGen
*self
);
28 // generates a random number on between 0.0 and 1.0
29 BASEKIT_API
double RandomGen_randomDouble(RandomGen
*self
);
31 BASEKIT_API
int RandomGen_randomInt(RandomGen
*self
);
33 BASEKIT_API
double RandomGen_gaussian(RandomGen
*self
, double mean
, double standardDeviation
);