You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.3 KiB

#include <inttypes.h>
#define PRNG_FLOAT (0)
/**
* @brief initializes mt[N] with a seed
*
* @param s seed for the PRNG
*/
void init_genrand(uint32_t s);
/**
* @brief initialize by an array with array-length
* init_key is the array for initializing keys
* key_length is its length
* slight change for C++, 2004/2/26
*
* @param init_key array of keys (seeds) to initialize the PRNG
* @param key_length number of lements in init_key
*/
void init_by_array(uint32_t init_key[], int key_length);
/**
* @brief generates a random number on [0,0xffffffff]-interval
* @return a random number on [0,0xffffffff]-interval
*/
uint32_t genrand_uint32(void);
#if PRNG_FLOAT
/* These real versions are due to Isaku Wada, 2002/01/09 added */
/**
* @brief generates a random number on [0,1]-real-interval
* @return a random number on [0,1]-real-interval
*/
double genrand_real1(void);
/**
* @brief generates a random number on [0,1)-real-interval
* @return a random number on [0,1)-real-interval
*/
double genrand_real2(void);
/**
* @brief generates a random number on (0,1)-real-interval
* @return a random number on (0,1)-real-interval
*/
double genrand_real3(void);
/**
* @brief generates a random number on [0,1) with 53-bit resolution
* @return a random number on [0,1) with 53-bit resolution
*/
double genrand_res53(void);
#endif /* PRNG_FLOAT */