PCL
Random Number Generation

Classes

class  pcl::GammaRandomDeviates< RNG >
 Generation of random gamma deviates. More...
 
class  pcl::NormalRandomDeviates< RNG >
 Generation of random normal (Gaussian) deviates. More...
 
class  pcl::PoissonRandomDeviates< RNG >
 Generation of random Poisson deviates. More...
 
class  pcl::RandomNumberGenerator
 Mersenne Twister (MT19937) pseudo-random number generator. More...
 
class  pcl::XoRoShiRo1024ss
 Implementation of the xoroshiro1024** pseudo-random number generator. More...
 
class  pcl::XorShift1024
 Implementation of the XorShift1024* pseudo-random number generator. More...
 
class  pcl::XoShiRo256ss
 Implementation of the xoshiro256** pseudo-random number generator. More...
 

Functions

uint32 pcl::RandomSeed32 ()
 
uint64 pcl::RandomSeed64 ()
 

Detailed Description

Function Documentation

◆ RandomSeed32()

uint32 pcl::RandomSeed32 ( )
inline

Returns a 32-bit random generator seed.

This function simply calls RandomSeed64() and returns the XOR combination of the 32-bit words in the 64-bit random seed.

As RandomSeed64(), this function is thread-safe and is guaranteed to return a unique value on each call.

Definition at line 102 of file Random.h.

References pcl::RandomSeed64().

◆ RandomSeed64()

uint64 pcl::RandomSeed64 ( )

Returns a 64-bit random generator seed.

On UNIX/Linux platforms, this function reads the /dev/urandom system device to acquire a high-quality random seed. On Windows, the rand_s() CRT function is invoked with the same purpose.

In the extremely rare cases where a system random seed cannot be obtained, the time() function is used to get a unique initialization value.

Subsequent calls to this function are guaranteed to return unique values.

This function is thread-safe. It can be safely called from multiple execution threads running concurrently.

Referenced by pcl::XorShift1024::Initialize(), pcl::XoShiRo256ss::Initialize(), pcl::XoRoShiRo1024ss::Initialize(), and pcl::RandomSeed32().