Public Member Functions | Protected Attributes | List of all members
sick_scan_xd::UniformRandomInteger Class Reference

#include <random_generator.h>

Public Member Functions

std::vector< uint8_t > generate (int data_size)
 
int generate (void)
 
 UniformRandomInteger (int lower_bound=0, int upper_bound=255)
 

Protected Attributes

int m_lower_bound
 
std::random_device m_random_device
 random device More...
 
std::mt19937 m_random_engine
 mersenne twister engine More...
 
std::uniform_int_distribution< int > m_uniform_distribution
 uniform integer distribution More...
 
int m_upper_bound
 

Detailed Description

class UniformRandomInteger generates uniform distributed integer random numbers.

Definition at line 67 of file random_generator.h.

Constructor & Destructor Documentation

◆ UniformRandomInteger()

sick_scan_xd::UniformRandomInteger::UniformRandomInteger ( int  lower_bound = 0,
int  upper_bound = 255 
)

UniformRandomInteger constructor

Parameters
[in]lower_boundmin. value of random distribution, random numbers will be generated within the range lower_bound up to upper_bound,(lower and upper bound included)
[in]upper_boundmax. value of random distribution, random numbers will be generated within the range lower_bound up to upper_bound (lower and upper bound included)

UniformRandomInteger constructor

Parameters
[in]lower_boundmin. value of random distribution, random numbers will be generated within the range lower_bound up to upper_bound
[in]upper_boundmax. value of random distribution, random numbers will be generated within the range lower_bound up to upper_bound

Definition at line 66 of file random_generator.cpp.

Member Function Documentation

◆ generate() [1/2]

std::vector< uint8_t > sick_scan_xd::UniformRandomInteger::generate ( int  data_size)

Creates and returns uniform distributed binary random data of a given size

Parameters
[in]data_sizenumber of random bytes created, size of output data
Returns
binary random data of length data_size

Definition at line 85 of file random_generator.cpp.

◆ generate() [2/2]

int sick_scan_xd::UniformRandomInteger::generate ( void  )

Returns a uniform distributed integer random number within the range lower_bound up to upper_bound

Returns
uniform distributed random number

Returns a uniform distributed integer random number within the range lower_bound up to upper_bound

Definition at line 75 of file random_generator.cpp.

Member Data Documentation

◆ m_lower_bound

int sick_scan_xd::UniformRandomInteger::m_lower_bound
protected

Definition at line 97 of file random_generator.h.

◆ m_random_device

std::random_device sick_scan_xd::UniformRandomInteger::m_random_device
protected

random device

Definition at line 99 of file random_generator.h.

◆ m_random_engine

std::mt19937 sick_scan_xd::UniformRandomInteger::m_random_engine
protected

mersenne twister engine

Definition at line 100 of file random_generator.h.

◆ m_uniform_distribution

std::uniform_int_distribution<int> sick_scan_xd::UniformRandomInteger::m_uniform_distribution
protected

uniform integer distribution

Definition at line 101 of file random_generator.h.

◆ m_upper_bound

int sick_scan_xd::UniformRandomInteger::m_upper_bound
protected

Definition at line 98 of file random_generator.h.


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


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:21