A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
 RngStream (uint32_t seed, uint64_t stream, uint64_t substream)
 Construct from explicit seed, stream and substream values.
 
double RandU01 ()
 Generate the next random number for this stream.
 

Private Member Functions

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

Private Attributes

double m_currentState [6]
 The RNG state vector.
 

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 38 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 367 of file rng-stream.cc.

References AdvanceNthBy(), MRG32k3a::m1, MRG32k3a::m2, m_currentState, and NS_FATAL_ERROR.

+ Here is the call graph for this function:

◆ RngStream() [2/2]

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

Copy constructor.

Parameters
[in]rThe RngStream to copy.

Definition at line 381 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 390 of file rng-stream.cc.

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

Referenced by RngStream().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RandU01()

Member Data Documentation

◆ m_currentState

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

The RNG state vector.

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

Referenced by RngStream(), RngStream(), and RandU01().


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