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

Combined Multiple-Recursive Generator MRG32k3a. More...

#include "rng-stream.h"

+ Collaboration diagram for ns3::RngStream:

Public Member Functions

 RngStream (const RngStream &r)
 Copy constructor. More...
 
 RngStream (uint32_t seed, uint64_t stream, uint64_t substream)
 Construct from explicit seed, stream and substream values. 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

◆ RngStream() [1/2]

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

Construct from explicit seed, stream and substream values.

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

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

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

◆ RngStream() [2/2]

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

Copy constructor.

Parameters
[in]rThe RngStream to copy.

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

References m_currentState.

Member Function Documentation

◆ AdvanceNthBy()

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

Advance state of the RNG by leaps and bounds.

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

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

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

+ Here is the call graph for this function:

◆ RandU01()

Member Data Documentation

◆ m_currentState

double ns3::RngStream::m_currentState[6]
private

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: