RngStream.h
Go to the documentation of this file.
#ifndef RNGSTREAM_H
#define RNGSTREAM_H
#include <string>
#include <stdint.h>
namespace ssim {
class RngStream
{
public:
RngStream (const char *name = "");
static bool SetPackageSeed (const double seed[6]);
void ResetStartStream ();
void ResetStartSubstream ();
void ResetNextSubstream ();
void SetAntithetic (bool a);
void IncreasedPrecis (bool incp);
bool SetSeed (const double seed[6]);
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]);
void AdvanceState (int32_t e, int32_t c);
void AdvanceSubstream (int32_t e, int32_t c);
void AdvanceStream (int32_t e, int32_t c);
void CalcMatrix (int32_t e, int32_t c, double C1[3][3], double C2[3][3]);
void GetState (double seed[6]) const;
/* void WriteState () const; */
/* void WriteStateFull () const; */
double RandU01 ();
int RandInt (int i, int j);
private:
double Cg[6], Bg[6], Ig[6];
bool anti, incPrec;
std::string name;
static double nextSeed[6];
double U01 ();
double U01d ();
};
} // ssim namespace
#endif
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