MRPT  2.0.0
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
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

Definition at line 45 of file RandomGenerators.h.

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.

◆ 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 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020