gem5  v20.1.0.0
Public Member Functions | Private Attributes | List of all members
Random Class Reference

#include <random.hh>

Inheritance diagram for Random:
Serializable

Public Member Functions

 ~Random ()
 
void init (uint32_t s)
 
template<typename T >
std::enable_if< std::is_integral< T >::value, T >::type random ()
 Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating point. More...
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type random ()
 
template<typename T >
std::enable_if< std::is_integral< T >::value, T >::type random (T min, T max)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
 Random ()
 
 Random (uint32_t s)
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Private Attributes

std::mt19937_64 gen
 

Additional Inherited Members

- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 Serializes all the SimObjects. More...
 
static void unserializeGlobals (CheckpointIn &cp)
 

Detailed Description

Definition at line 58 of file random.hh.

Constructor & Destructor Documentation

◆ ~Random()

Random::~Random ( )

Definition at line 59 of file random.cc.

Member Function Documentation

◆ init()

void Random::init ( uint32_t  s)

Definition at line 64 of file random.cc.

References gen, and ArmISA::s.

Referenced by DistIface::init(), pybind_init_core(), and Random().

◆ random()

template<typename T >
std::enable_if<std::is_floating_point<T>::value, T>::type Random::random ( )
inline

Definition at line 98 of file random.hh.

References Stats::dist, and gen.

◆ serialize()

void Random::serialize ( CheckpointOut cp) const
overridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 70 of file random.cc.

References gen, panic, and paramOut().

◆ unserialize()

void Random::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Definition at line 82 of file random.cc.

References gen, optParamIn(), and panic.

Member Data Documentation

◆ gen

std::mt19937_64 Random::gen
private

Definition at line 63 of file random.hh.

Referenced by init(), random(), serialize(), and unserialize().


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

Generated on Wed Sep 30 2020 14:02:29 for gem5 by doxygen 1.8.17