Classes | Static Public Member Functions | Static Private Attributes | List of all members
DUtils::Random Class Reference

Functions to generate pseudo-random numbers. More...

#include <Random.h>

Classes

class  UnrepeatedRandomizer
 Provides pseudo-random numbers with no repetitions. More...
 

Static Public Member Functions

template<class T >
static T RandomGaussianValue (T mean, T sigma)
 
static int RandomInt (int min, int max)
 
template<class T >
static T RandomValue ()
 
template<class T >
static T RandomValue (T min, T max)
 
static void SeedRand ()
 
static void SeedRand (int seed)
 
static void SeedRandOnce ()
 
static void SeedRandOnce (int seed)
 

Static Private Attributes

static bool m_already_seeded = false
 If SeedRandOnce() or SeedRandOnce(int) have already been called. More...
 

Detailed Description

Functions to generate pseudo-random numbers.

Definition at line 21 of file Random.h.

Member Function Documentation

template<class T >
static T DUtils::Random::RandomGaussianValue ( mean,
sigma 
)
inlinestatic

Returns a random number from a gaussian distribution

Parameters
mean
sigmastandard deviation

Definition at line 85 of file Random.h.

int DUtils::Random::RandomInt ( int  min,
int  max 
)
static

Returns a random int in the range [min..max]

Parameters
min
max
Returns
random int in [min..max]

Definition at line 47 of file Random.cpp.

template<class T >
static T DUtils::Random::RandomValue ( )
inlinestatic

Returns a random number in the range [0..1]

Returns
random T number in [0..1]

Definition at line 56 of file Random.h.

template<class T >
static T DUtils::Random::RandomValue ( min,
max 
)
inlinestatic

Returns a random number in the range [min..max]

Parameters
min
max
Returns
random T number in [min..max]

Definition at line 67 of file Random.h.

void DUtils::Random::SeedRand ( )
static

Sets the random number seed to the current time

Definition at line 18 of file Random.cpp.

void DUtils::Random::SeedRand ( int  seed)
static

Sets the given random number seed

Parameters
seed

Definition at line 33 of file Random.cpp.

void DUtils::Random::SeedRandOnce ( )
static

Sets the random number seed to the current time only the first time this function is called

Definition at line 24 of file Random.cpp.

void DUtils::Random::SeedRandOnce ( int  seed)
static

Sets the given random number seed only the first time this function is called

Parameters
seed

Definition at line 38 of file Random.cpp.

Member Data Documentation

bool DUtils::Random::m_already_seeded = false
staticprivate

If SeedRandOnce() or SeedRandOnce(int) have already been called.

Definition at line 105 of file Random.h.


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


orb_slam2_with_maps_odom
Author(s): teng zhang
autogenerated on Fri Sep 25 2020 03:24:47