1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
3
// Copyright (C) 2001 Pierre L'Ecuyer (lecuyer@iro.umontreal.ca)
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License version 2 as
7
// published by the Free Software Foundation;
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
// Modified for ns-3 by: Rajib Bhattacharjea<raj.b@gatech.edu>
29
* \ingroup randomvariable
31
* \brief Combined Multiple-Recursive Generator MRG32k3a
33
* This class is the combined multiple-recursive random number
34
* generator called MRG32k3a. The ns3::RandomVariableBase class
35
* holds a static instance of this class. The details of this
36
* class are explained in:
37
* http://www.iro.umontreal.ca/~lecuyer/myftp/papers/streams00.pdf
42
RngStream (const RngStream&);
43
void InitializeStream (); // Separate initialization
44
void ResetStartStream ();
45
void ResetStartSubstream ();
46
void ResetNextSubstream ();
47
void ResetNthSubstream (uint32_t N);
48
void SetAntithetic (bool a);
49
void IncreasedPrecis (bool incp);
50
bool SetSeeds (const uint32_t seed[6]);
51
void AdvanceState (int32_t e, int32_t c);
52
void GetState (uint32_t seed[6]) const;
54
int32_t RandInt (int32_t i, int32_t j);
55
public: //public static api
56
static bool SetPackageSeed (uint32_t seed);
57
static bool SetPackageSeed (const uint32_t seed[6]);
58
static void GetPackageSeed (uint32_t seed[6]);
59
static void SetPackageRun (uint32_t run);
60
static uint32_t GetPackageRun (void);
61
static bool CheckSeed (const uint32_t seed[6]);
62
static bool CheckSeed (uint32_t seed);
64
double Cg[6], Bg[6], Ig[6];
68
static uint32_t EnsureGlobalInitialized (void);
69
private: //static data
70
static double nextSeed[6];