2 * random.c - random functions header file
4 * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
13 typedef struct s_random {
24 #define RAND_STAT_INITIALIZED 0x01
25 #define RAND_STAT_VERBOSE 0x02
26 #define RAND_STAT_UDEV 0x04
27 #define RAND_STAT_GAUSS 0x08
29 #define RAND_BUFSIZE (1024*1024) /* 4 mega byte */
31 #define URAND_MAX 0xffffffff
32 #define URAND_MAX_PLUS_ONE 0x100000000
34 /* function prototypes */
36 int rand_init(t_random *random,char *randomfile,int logfd);
37 int rand_close(t_random *random);
38 unsigned int rand_get(t_random *random);
39 double rand_get_double(t_random *random);
40 double rand_get_double_linear(t_random *random,double a,double b);
41 double rand_get_gauss(t_random *random);
42 unsigned int rand_get_int_linear(t_random *radnom,unsigned int max,
44 unsigned int rand_get_reject(t_random *random,unsigned int max_x,
45 unsigned int max_y,unsigned int *graph);