Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
8b80e54533d4f9acf9eb40a599b2d01c0a240596
[simgrid.git] / include / xbt / RngStream.h
1 /* Copyright (c) 2012, 2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 /* RngStream.h for ANSI C */
8 #ifndef RNGSTREAM_H
9 #define RNGSTREAM_H
10
11 #include "misc.h"
12
13 typedef struct RngStream_InfoState * RngStream;
14
15 struct RngStream_InfoState {
16    double Cg[6], Bg[6], Ig[6];
17    int Anti;
18    int IncPrec;
19    char *name;
20 };
21
22
23 XBT_PUBLIC(int) RngStream_SetPackageSeed (unsigned long seed[6]);
24
25
26 XBT_PUBLIC(RngStream) RngStream_CreateStream (const char name[]);
27
28
29 XBT_PUBLIC(void) RngStream_DeleteStream (RngStream *pg);
30
31
32 XBT_PUBLIC(RngStream) RngStream_CopyStream (const RngStream src);
33
34
35 XBT_PUBLIC(void) RngStream_ResetStartStream (RngStream g);
36
37
38 XBT_PUBLIC(void) RngStream_ResetStartSubstream (RngStream g);
39
40
41 XBT_PUBLIC(void) RngStream_ResetNextSubstream (RngStream g);
42
43
44 XBT_PUBLIC(void) RngStream_SetAntithetic (RngStream g, int a);
45
46
47 XBT_PUBLIC(void) RngStream_IncreasedPrecis (RngStream g, int incp);
48
49
50 XBT_PUBLIC(int) RngStream_SetSeed (RngStream g, unsigned long seed[6]);
51
52
53 XBT_PUBLIC(void) RngStream_AdvanceState (RngStream g, long e, long c);
54
55
56 XBT_PUBLIC(void) RngStream_GetState (RngStream g, unsigned long seed[6]);
57
58
59 XBT_PUBLIC(void) RngStream_WriteState (RngStream g);
60
61
62 XBT_PUBLIC(void) RngStream_WriteStateFull (RngStream g);
63
64
65 XBT_PUBLIC(double) RngStream_RandU01 (RngStream g);
66
67
68 XBT_PUBLIC(int) RngStream_RandInt (RngStream g, int i, int j);
69
70
71 #endif
72
73