libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
crn::UnivariateRandomTools Namespace Reference

Univariate random toolbox class. More...

Functions

std::vector< double > NewUniformSample (size_t n=1, bool reseed=true)
 Creates a data sample following an uniform probability law. More...
 
std::vector< double > NewGaussianSample (double mu=0.0, double sigma=1.0, size_t n=1, size_t m=100, bool reseed=true)
 Creates a data sample following a Gaussian probability law. More...
 
std::vector< double > NewGaussianMixtureSample (const UnivariateGaussianMixture &Mx, size_t n=1, size_t m=100, bool reseed=true)
 Creates a data sample following a Gaussian probability law. More...
 

Detailed Description

Univariate random toolbox class.

Tools for random samples

Author
Jean DUONG
Date
August 2008
Version
0.2

Function Documentation

std::vector< double > crn::UnivariateRandomTools::NewGaussianMixtureSample ( const UnivariateGaussianMixture Mx,
size_t  n = 1,
size_t  m = 100,
bool  reseed = true 
)

Creates a data sample following a Gaussian probability law.

Simulate a gaussian mixture random sample

Parameters
[in]MxUnivariateGaussianMixture*
[in]nsize of gaussian sample (default = 1)
[in]msize of temporary uniform sample (default = 100)
[in]reseedshall the random seed be reinitialized?
Returns
a set of patterns generated by the Gaussian law

Definition at line 103 of file CRNUnivariateRandomTools.cpp.

std::vector< double > crn::UnivariateRandomTools::NewGaussianSample ( double  mu = 0.0,
double  sigma = 1.0,
size_t  n = 1,
size_t  m = 100,
bool  reseed = true 
)

Creates a data sample following a Gaussian probability law.

Simulate a gaussian random sample

With default values mu = 0 and sigma = 1, we obtain the normal random sample

Parameters
[in]mumean of gaussian distribution (default = 0)
[in]sigmadeviation of gaussian distribution (default = 1)
[in]nsize of gaussian sample (default = 1)
[in]msize of temporary uniform sample (default = 100)
[in]reseedshall the random seed be reinitialized?
Returns
a set of patterns generated by the Gaussian law

Definition at line 65 of file CRNUnivariateRandomTools.cpp.

std::vector< double > crn::UnivariateRandomTools::NewUniformSample ( size_t  n = 1,
bool  reseed = true 
)

Creates a data sample following an uniform probability law.

Simulate a uniform random sample in [0;1]

Parameters
[in]nsize of sample
[in]reseedshall the random seed be reinitialized?
Returns
a set of patterns generated by the uniform law

Definition at line 38 of file CRNUnivariateRandomTools.cpp.