Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[xbt] C++ support for RngStream.h
[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 SG_BEGIN_DECL();
23
24 XBT_PUBLIC(int) RngStream_SetPackageSeed (unsigned long seed[6]);
25
26
27 XBT_PUBLIC(RngStream) RngStream_CreateStream (const char name[]);
28
29
30 XBT_PUBLIC(void) RngStream_DeleteStream (RngStream *pg);
31
32
33 XBT_PUBLIC(RngStream) RngStream_CopyStream (const RngStream src);
34
35
36 XBT_PUBLIC(void) RngStream_ResetStartStream (RngStream g);
37
38
39 XBT_PUBLIC(void) RngStream_ResetStartSubstream (RngStream g);
40
41
42 XBT_PUBLIC(void) RngStream_ResetNextSubstream (RngStream g);
43
44
45 XBT_PUBLIC(void) RngStream_SetAntithetic (RngStream g, int a);
46
47
48 XBT_PUBLIC(void) RngStream_IncreasedPrecis (RngStream g, int incp);
49
50
51 XBT_PUBLIC(int) RngStream_SetSeed (RngStream g, unsigned long seed[6]);
52
53
54 XBT_PUBLIC(void) RngStream_AdvanceState (RngStream g, long e, long c);
55
56
57 XBT_PUBLIC(void) RngStream_GetState (RngStream g, unsigned long seed[6]);
58
59
60 XBT_PUBLIC(void) RngStream_WriteState (RngStream g);
61
62
63 XBT_PUBLIC(void) RngStream_WriteStateFull (RngStream g);
64
65
66 XBT_PUBLIC(double) RngStream_RandU01 (RngStream g);
67
68
69 XBT_PUBLIC(int) RngStream_RandInt (RngStream g, int i, int j);
70
71 SG_END_DECL();
72
73 #endif
74
75