Public Member Functions | Protected Attributes | List of all members
sick_scan::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

boost::mt19937 m_random_engine
 mersenne twister engine More...
 
boost::variate_generator< boost::mt19937 &, boost::uniform_int<> > m_random_generator
 random number generator (glues mersenne engine and distribution) More...
 
boost::uniform_int m_uniform_distribution
 uniform integer distribution More...
 

Detailed Description

class UniformRandomInteger generates uniform distributed integer random numbers.

Definition at line 65 of file random_generator.h.

Constructor & Destructor Documentation

◆ UniformRandomInteger()

sick_scan::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 67 of file random_generator.cpp.

Member Function Documentation

◆ generate() [1/2]

std::vector< uint8_t > sick_scan::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::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_random_engine

boost::mt19937 sick_scan::UniformRandomInteger::m_random_engine
protected

mersenne twister engine

Definition at line 95 of file random_generator.h.

◆ m_random_generator

boost::variate_generator<boost::mt19937&, boost::uniform_int<> > sick_scan::UniformRandomInteger::m_random_generator
protected

random number generator (glues mersenne engine and distribution)

Definition at line 97 of file random_generator.h.

◆ m_uniform_distribution

boost::uniform_int sick_scan::UniformRandomInteger::m_uniform_distribution
protected

uniform integer distribution

Definition at line 96 of file random_generator.h.


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


sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Thu Sep 8 2022 02:30:20