MRPT  1.9.9
mrpt::random::Generator_MT19937 Class Reference

Detailed Description

Portable MT19937 random generator, C++11 UniformRandomBitGenerator compliant.

It is ensured to generate the same numbers on any compiler and system.

Definition at line 42 of file RandomGenerators.h.

#include <mrpt/random/RandomGenerators.h>

Public Types

using result_type = uint32_t
 

Public Member Functions

result_type operator() ()
 
void seed (const uint32_t seed)
 

Static Public Member Functions

static constexpr result_type min ()
 
static constexpr result_type max ()
 

Private Member Functions

void generateNumbers ()
 

Private Attributes

uint32_t m_MT [624]
 
uint32_t m_index {0}
 
bool m_seed_initialized {false}
 

Member Typedef Documentation

◆ result_type

Member Function Documentation

◆ generateNumbers()

void Generator_MT19937::generateNumbers ( )
private

Definition at line 59 of file RandomGenerator.cpp.

References m_MT, m_seed_initialized, seed(), and twist().

Referenced by operator()().

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

◆ max()

static constexpr result_type mrpt::random::Generator_MT19937::max ( )
inlinestatic

Definition at line 50 of file RandomGenerators.h.

◆ min()

static constexpr result_type mrpt::random::Generator_MT19937::min ( )
inlinestatic

Definition at line 46 of file RandomGenerators.h.

References min.

◆ operator()()

Generator_MT19937::result_type Generator_MT19937::operator() ( )

Definition at line 42 of file RandomGenerator.cpp.

References generateNumbers(), m_index, and m_MT.

Here is the call graph for this function:

◆ seed()

void Generator_MT19937::seed ( const uint32_t  seed)

Definition at line 77 of file RandomGenerator.cpp.

References m_index, m_MT, and m_seed_initialized.

Referenced by generate_test_data(), generateNumbers(), and mrpt::random::CRandomGenerator::randomize().

Here is the caller graph for this function:

Member Data Documentation

◆ m_index

uint32_t mrpt::random::Generator_MT19937::m_index {0}
private

Definition at line 61 of file RandomGenerators.h.

Referenced by operator()(), and seed().

◆ m_MT

uint32_t mrpt::random::Generator_MT19937::m_MT[624]
private

Definition at line 60 of file RandomGenerators.h.

Referenced by generateNumbers(), operator()(), and seed().

◆ m_seed_initialized

bool mrpt::random::Generator_MT19937::m_seed_initialized {false}
private

Definition at line 62 of file RandomGenerators.h.

Referenced by generateNumbers(), and seed().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019