ROSS
rand-clcg4.h
Go to the documentation of this file.
1 #ifndef INC_clcg4_h
2 #define INC_clcg4_h
3 
4 typedef int32_t * tw_seed;
5 
6 struct tw_rng
7 {
8  /*
9  * equals a[i]^{m[i]-2} mod m[i]
10  */
11  long long b[4];
12 
13  /*
14  * a[j]^{2^w} et a[j]^{2^{v+w}}.
15  */
16  int32_t m[4];
17  int32_t a[4];
18  int32_t aw[4];
19  int32_t avw[4];
20 
21  // the seed..
22  int32_t seed[4];
23 };
24 
26 {
28 };
29 
30 typedef enum SeedType SeedType;
31 
33 {
34  unsigned long count;
35  int32_t Ig[4];
36  int32_t Lg[4];
37  int32_t Cg[4];
38 
39  //tw_rng *rng;
40 
41 #ifdef RAND_NORMAL
42  double tw_normal_u1;
43  double tw_normal_u2;
45 #endif
46 };
47 
48 extern tw_rng *rng_init(int v, int w);
49 extern void rng_set_initial_seed();
50 extern void rng_init_generator(tw_rng_stream * g, SeedType Where);
51 extern void rng_set_seed(tw_rng_stream * g, uint32_t * s);
52 extern void rng_get_state(tw_rng_stream * g, uint32_t * s);
53 extern void rng_write_state(tw_rng_stream * g, FILE *f);
54 extern double rng_gen_val(tw_rng_stream * g);
55 extern double rng_gen_reverse_val(tw_rng_stream * g);
56 
57 #endif
tw_rng * rng_init(int v, int w)
Definition: rand-clcg4.c:338
SeedType
Definition: rand-clcg4.h:25
void rng_write_state(tw_rng_stream *g, FILE *f)
Definition: rand-clcg4.c:198
void rng_set_initial_seed()
int32_t a[4]
Definition: rand-clcg4.h:17
int32_t avw[4]
Definition: rand-clcg4.h:19
void rng_get_state(tw_rng_stream *g, uint32_t *s)
double tw_normal_u2
Definition: rand-clcg4.h:43
int32_t aw[4]
Definition: rand-clcg4.h:18
int32_t * tw_seed
Definition: rand-clcg4.h:4
double tw_normal_u1
Definition: rand-clcg4.h:42
double rng_gen_reverse_val(tw_rng_stream *g)
Definition: rand-clcg4.c:451
long long b[4]
Definition: rand-clcg4.h:11
int32_t seed[4]
Definition: rand-clcg4.h:22
int32_t Ig[4]
Definition: rand-clcg4.h:35
int tw_normal_flipflop
Definition: rand-clcg4.h:44
void rng_init_generator(tw_rng_stream *g, SeedType Where)
Definition: rand-clcg4.c:239
int32_t Lg[4]
Definition: rand-clcg4.h:36
double rng_gen_val(tw_rng_stream *g)
Definition: rand-clcg4.c:392
void rng_set_seed(tw_rng_stream *g, uint32_t *s)
unsigned long count
Definition: rand-clcg4.h:34
int32_t m[4]
Definition: rand-clcg4.h:16
int32_t Cg[4]
Definition: rand-clcg4.h:37