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