Microsimulation API

RngStream.h
Go to the documentation of this file.
1
22 #ifndef RNGSTREAM_H
23 #define RNGSTREAM_H
24
25 #include <string>
26 #include <stdint.h>
27
28 namespace ssim {
29
30 class RngStream
31 {
32 public:
33
34 RngStream (const char *name = "");
35
36
37 static bool SetPackageSeed (const double seed[6]);
38
39
40 void ResetStartStream ();
41
42
43 void ResetStartSubstream ();
44
45
46 void ResetNextSubstream ();
47
48
49 void SetAntithetic (bool a);
50
51
52 void IncreasedPrecis (bool incp);
53
54
55 bool SetSeed (const double seed[6]);
56
57
58 void GenAdvanceState (int32_t e, int32_t c,
59 const double A1[3][3], const double A2[3][3],
60 const double InvA1[3][3], const double InvA2[3][3]);
61
62
63 void AdvanceState (int32_t e, int32_t c);
64
65
66 void AdvanceSubstream (int32_t e, int32_t c);
67
68
69 void AdvanceStream (int32_t e, int32_t c);
70
71
72 void CalcMatrix (int32_t e, int32_t c, double C1[3][3], double C2[3][3]);
73
74
75 void GetState (double seed[6]) const;
76
77
78 /* void WriteState () const; */
79
80
81 /* void WriteStateFull () const; */
82
83
84 double RandU01 ();
85
86
87 int RandInt (int i, int j);
88
89
90
91 private:
92
93 double Cg[6], Bg[6], Ig[6];
94
95
96 bool anti, incPrec;
97
98
99 std::string name;
100
101
102 static double nextSeed[6];
103
104
105 double U01 ();
106
107
108 double U01d ();
109
110
111 };
112
113 } // ssim namespace
114
115 #endif
116
117
ssim::RngStream::U01d
double U01d()
Definition: RngStream.cpp:305
ssim::RngStream::RngStream
RngStream(const char *name="")
Definition: RngStream.cpp:337
ssim::RngStream::Cg
double Cg[6]
Definition: RngStream.h:93
ssim::RngStream::SetPackageSeed
static bool SetPackageSeed(const double seed[6])
Definition: RngStream.cpp:391
ssim::RngStream::AdvanceSubstream
void AdvanceSubstream(int32_t e, int32_t c)
Definition: RngStream.cpp:454
ssim::RngStream::nextSeed
static double nextSeed[6]
Definition: RngStream.h:102
ssim::RngStream::CalcMatrix
void CalcMatrix(int32_t e, int32_t c, double C1[3][3], double C2[3][3])
Definition: RngStream.cpp:467
ssim::RngStream::AdvanceStream
void AdvanceStream(int32_t e, int32_t c)
Definition: RngStream.cpp:460
ssim::RngStream::ResetStartStream
void ResetStartStream()
Definition: RngStream.cpp:361
ssim::RngStream::GenAdvanceState
void GenAdvanceState(int32_t e, int32_t c, const double A1[3][3], const double A2[3][3], const double InvA1[3][3], const double InvA2[3][3])
Definition: RngStream.cpp:418
ssim::RngStream::name
std::string name
Definition: RngStream.h:99
ssim::RngStream::RandInt
int RandInt(int i, int j)
Definition: RngStream.cpp:578
ssim::RngStream::U01
double U01()
Definition: RngStream.cpp:276
ssim::RngStream::SetSeed
bool SetSeed(const double seed[6])
Definition: RngStream.cpp:402
ssim::RngStream::ResetNextSubstream
void ResetNextSubstream()
Definition: RngStream.cpp:381
ssim::RngStream::GetState
void GetState(double seed[6]) const
Definition: RngStream.cpp:496
ssim::RngStream::incPrec
bool incPrec
Definition: RngStream.h:96
ssim::RngStream::Ig
double Ig[6]
Definition: RngStream.h:93
ssim::RngStream::anti
bool anti
Definition: RngStream.h:96
ssim::RngStream::ResetStartSubstream
void ResetStartSubstream()
Definition: RngStream.cpp:371
ssim
name space for the Siena simulator.
Definition: microsimulation.cc:3
ssim::RngStream::RandU01
double RandU01()
Definition: RngStream.cpp:566
ssim::RngStream::IncreasedPrecis
void IncreasedPrecis(bool incp)
Definition: RngStream.cpp:550
ssim::RngStream::Bg
double Bg[6]
Definition: RngStream.h:93
ssim::RngStream::SetAntithetic
void SetAntithetic(bool a)
Definition: RngStream.cpp:557
ssim::RngStream::AdvanceState
void AdvanceState(int32_t e, int32_t c)
Definition: RngStream.cpp:450
ssim::RngStream
Definition: RngStream.h:30