PCL
|
Mersenne Twister (MT19937) pseudo-random number generator. More...
#include <Random.h>
Public Member Functions | |
RandomNumberGenerator (double ymax=1.0, uint32 seed=0) | |
virtual | ~RandomNumberGenerator () |
double | Gaussian (double mean=0, double sigma=1) |
double | Normal (double mean=0, double sigma=1) |
double | operator() () |
int | Poisson (double lambda) |
double | Rand1 () |
uint32 | Rand32 () |
void | SetUpperBound (double ymax) |
double | Uniform () |
double | UpperBound () const |
Generation of pseudo-random numbers with user-selectable range and probability distributions.
This generator supports the uniform, normal (Gaussian) and Poisson distributions. In addition, the upper range of generated uniform deviates can be arbitrarily defined.
RandomNumberGenerator is a functional class. The function call operator()() returns pseudo-random numbers in the range [0,ymax], where ymax is the user-defined arbitrary upper range.
Example of use:
References
Based on an adaptation of SIMD-oriented Fast Mersenne Twister (SFMT) by Mutsuo Saito and Makoto Matsumoto (Hiroshima University).
Currently PCL implements a SFMT generator with a period of 2^19937-1.
SFMT Copyright (C) 2006, 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima University. All rights reserved.
pcl::RandomNumberGenerator::RandomNumberGenerator | ( | double | ymax = 1.0 , |
uint32 | seed = 0 |
||
) |
Constructs a RandomNumberGenerator object.
ymax | Upper bound of uniform deviates. The function call operator double operator()() and the Uniform() member function (which are synonyms) will return uniform pseudo-random deviates in the range [0,ymax]. The default value is 1.0. |
seed | 32-bit initialization seed. If this parameter is zero, a unique random seed will be generated automatically. The default value is zero. |
|
virtual |
Virtual destructor.
|
inline |
double pcl::RandomNumberGenerator::Normal | ( | double | mean = 0 , |
double | sigma = 1 |
||
) |
Generates a floating point normal deviate with the specified mean and standard deviation sigma.
|
inline |
Generates a floating point uniform deviate in the range [0,UpperBound()]
int pcl::RandomNumberGenerator::Poisson | ( | double | lambda | ) |
Generates a discrete random deviate from a Poisson distribution with the specified expected value lambda.
|
inline |
Generates a floating point uniform deviate in the range 0,1.
Definition at line 195 of file Random.h.
References uint32_max.
uint32 pcl::RandomNumberGenerator::Rand32 | ( | ) |
Generates a 32-bit unsigned integer uniform deviate.
|
inline |
Sets the upper bound ymax > 0 for this random number generator.
Definition at line 244 of file Random.h.
References uint32_max.
|
inline |
Generates a floating point uniform deviate in the range [0,UpperBound()]
This is a convenience alias for operator()().
|
inline |