DUNE: Uniform Navigational Environment  2019.02.1
DUNE::Math::Random::TSGenerator< G > Class Template Reference

Detailed Description

template<typename G>
class DUNE::Math::Random::TSGenerator< G >

Thread-safe wrapper for a Generator class.

Use this if the generator is going to be accessed by multiple threads.

Public Member Functions

 TSGenerator (void)
 
 TSGenerator (int32_t seed_value)
 
void seed (int32_t seed_value)
 
int32_t random (void)
 
double uniform (void)
 
- Public Member Functions inherited from DUNE::Math::Random::Generator
virtual ~Generator ()
 
double uniform (double a, double b)
 
double gaussian (void)
 
double gaussian (double mu, double sigma)
 
void ballU (double radius, double *x, double *y)
 
void ballG (double sigma, double *x, double *y)
 

Additional Inherited Members

- Static Public Member Functions inherited from DUNE::Math::Random::Generator
static int32_t arbitrarySeed (void)
 
- Static Public Attributes inherited from DUNE::Math::Random::Generator
static const int32_t c_max_random
 

Constructor & Destructor Documentation

template<typename G >
DUNE::Math::Random::TSGenerator< G >::TSGenerator ( void  )
inline
template<typename G >
DUNE::Math::Random::TSGenerator< G >::TSGenerator ( int32_t  seed_value)
inline

Member Function Documentation

template<typename G >
int32_t DUNE::Math::Random::TSGenerator< G >::random ( void  )
inlinevirtual

Generate a 32-bit signed integer, uniformly distributed in [0,c_max_random].

Returns
generated number.

Implements DUNE::Math::Random::Generator.

template<typename G >
void DUNE::Math::Random::TSGenerator< G >::seed ( int32_t  value)
inlinevirtual

Re-initialize generator with given seed.

Parameters
valuevalue for seed.

Implements DUNE::Math::Random::Generator.

template<typename G >
double DUNE::Math::Random::TSGenerator< G >::uniform ( void  )
inlinevirtual

Generate double-precision floating point number with uniform distribution in [0,1].

Default implementation returns value of random()/c_max_random.

Reimplemented from DUNE::Math::Random::Generator.

Collaboration diagram for DUNE::Math::Random::TSGenerator< G >:
Collaboration graph