gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
Random Class Reference

#include <random.hh>

Inheritance diagram for Random:
Serializable

Public Member Functions

 Random ()
 
 Random (uint32_t s)
 
 ~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...
 
- 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 ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 

Detailed Description

Definition at line 62 of file random.hh.

Constructor & Destructor Documentation

Random::Random ( )

Definition at line 52 of file random.cc.

References init().

Random::Random ( uint32_t  s)

Definition at line 58 of file random.cc.

References init().

Random::~Random ( )

Definition at line 63 of file random.cc.

Member Function Documentation

void Random::init ( uint32_t  s)

Definition at line 68 of file random.cc.

References gen.

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

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

Definition at line 92 of file random.hh.

References Stats::dist, and gen.

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

Definition at line 101 of file random.hh.

References Stats::dist, and gen.

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 74 of file random.cc.

References gen, panic, and paramOut().

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 86 of file random.cc.

References gen, optParamIn(), and panic.

Member Data Documentation

std::mt19937_64 Random::gen
private

Definition at line 67 of file random.hh.

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


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

Generated on Fri Jun 9 2017 13:04:17 for gem5 by doxygen 1.8.6