A Discrete-Event Network Simulator
ns3::RngStream Class Reference

Combined Multiple-Recursive Generator MRG32k3a. More...

#include "rng-stream.h"

Public Member Functions

 RngStream (uint32_t seed, uint64_t stream, uint64_t substream)
 Construct from explicit seed, stream and substream values. More...
 RngStream (const RngStream &r)
 Copy constructor. More...
double RandU01 (void)
 Generate the next random number for this stream. More...

Private Member Functions

void AdvanceNthBy (uint64_t nth, int by, double state[6])
 Advance state of the RNG by leaps and bounds. More...

Private Attributes

double m_currentState [6]
 The RNG state vector. More...

Detailed Description

Combined Multiple-Recursive Generator MRG32k3a.

This class is the combined multiple-recursive random number generator called MRG32k3a. The ns3::RandomVariableBase class holds a static instance of this class. The details of this class are explained in: http://www.iro.umontreal.ca/~lecuyer/myftp/papers/streams00.pdf

Definition at line 49 of file rng-stream.h.

Constructor & Destructor Documentation

ns3::RngStream::RngStream ( uint32_t  seed,
uint64_t  stream,
uint64_t  substream 

Construct from explicit seed, stream and substream values.

[in]seedThe starting seed.
[in]streamThe stream number.
[in]substreamThe sub-stream number.

Definition at line 363 of file rng-stream.cc.

References MRG32k3a::m1, MRG32k3a::m2, and NS_FATAL_ERROR.

ns3::RngStream::RngStream ( const RngStream r)

Copy constructor.

[in]rThe RngStream to copy.

Definition at line 377 of file rng-stream.cc.

References m_currentState.

Member Function Documentation

void ns3::RngStream::AdvanceNthBy ( uint64_t  nth,
int  by,
double  state[6] 

Advance state of the RNG by leaps and bounds.

[in]nthThe stream or substream index.
[in]byThe log2 base of nth.
[in]stateThe state vector to advance.

Definition at line 386 of file rng-stream.cc.

References MRG32k3a::m1, MRG32k3a::m2, MRG32k3a::MatVecModM(), and MRG32k3a::PowerOfTwoMatrix().

+ Here is the call graph for this function:

Member Data Documentation

double ns3::RngStream::m_currentState[6]

The RNG state vector.

Definition at line 85 of file rng-stream.h.

Referenced by RngStream().

The documentation for this class was generated from the following files: