pcl::common::NormalGenerator< T > Class Template Reference

NormalGenerator class generates a random number from a normal distribution specified by (mean, sigma). More...

`#include <pcl/common/random.h>`

## Classes

struct | Parameters

## Public Types

typedef boost::mt19937 | EngineType
typedef normal_distribution< T >::type | DistributionType

## Public Member Functions

| NormalGenerator (T mean=0, T sigma=1, pcl::uint32_t seed=-1)
| Constructor. More...
| NormalGenerator (const Parameters &parameters)
| Constructor. More...
void | setSeed (pcl::uint32_t seed)
| Change seed value. More...
void | setParameters (T mean, T sigma, pcl::uint32_t seed=-1)
| Set the normal number generator parameters. More...
void | setParameters (const Parameters &parameters)
| Set generator parameters. More...
const Parameters & | getParameters ()
T | run ()

## Public Attributes

Parameters | parameters_
| parameters More...
DistributionType | distribution_
| normal distribution More...
EngineType | rng_
| random number generator More...
boost::variate_generator< EngineType &, DistributionType > | generator_
| generator of random number from a normal distribution More...

## Detailed Description

### template<typename T>
class pcl::common::NormalGenerator< T >

NormalGenerator class generates a random number from a normal distribution specified by (mean, sigma).

Author
  Nizar Sallem

Definition at line 161 of file random.h.

## Member Typedef Documentation

## DistributionType

template<typename T >

typedef normal_distribution<T>::type pcl::common::NormalGenerator< T >::DistributionType

Definition at line 218 of file random.h.

## EngineType

template<typename T >

typedef boost::mt19937 pcl::common::NormalGenerator< T >::EngineType

Definition at line 217 of file random.h.

## Constructor & Destructor Documentation

## NormalGenerator() [1/2]

template<typename T >

pcl::common::NormalGenerator< T >::NormalGenerator | ( | T | mean = `0`,
|  | T | sigma = `1`,
|  | pcl::uint32_t | seed = `-1`
| ) |  |

Constructor.

Parameters

  [in] | mean | normal mean
  [in] | sigma | normal variation
  [in] | seed | seeding value

Definition at line 121 of file random.hpp.

References pcl::common::NormalGenerator< T >::parameters_, pcl::common::NormalGenerator< T >::rng_, and pcl::common::NormalGenerator< T >::Parameters::seed.

## NormalGenerator() [2/2]

template<typename T >

pcl::common::NormalGenerator< T >::NormalGenerator | ( | const Parameters & | parameters | ) |

Constructor.

Parameters

  parameters | normal distribution parameters and seed

Definition at line 133 of file random.hpp.

References pcl::common::NormalGenerator< T >::parameters_, pcl::common::NormalGenerator< T >::rng_, and pcl::common::NormalGenerator< T >::Parameters::seed.

## Member Function Documentation

## getParameters()

template<typename T >

const Parameters& pcl::common::NormalGenerator< T >::getParameters | ( |  | ) |

inline

Returns
  normal distribution parameters and generator seed

Definition at line 211 of file random.h.

## run()

template<typename T >

T pcl::common::NormalGenerator< T >::run | ( |  | ) |

inline

Returns
  a randomly generated number in the normal distribution (mean, sigma)

Definition at line 215 of file random.h.

## setParameters() [1/2]

template<typename T >

void pcl::common::NormalGenerator< T >::setParameters | ( | T | mean,
|  | T | sigma,
|  | pcl::uint32_t | seed = `-1`
| ) |  |

Set the normal number generator parameters.

Parameters

  [in] | mean | mean of the normal distribution
  [in] | sigma | standard variation of the normal distribution
  [in] | seed | random number generator seed (applied if != -1)

Definition at line 155 of file random.hpp.

References pcl::common::NormalGenerator< T >::distribution_, pcl::common::NormalGenerator< T >::generator_, pcl::common::NormalGenerator< T >::Parameters::mean, pcl::common::NormalGenerator< T >::parameters_, pcl::common::NormalGenerator< T >::rng_, pcl::common::NormalGenerator< T >::Parameters::seed, and pcl::common::NormalGenerator< T >::Parameters::sigma.

## setParameters() [2/2]

template<typename T >

void pcl::common::NormalGenerator< T >::setParameters | ( | const Parameters & | parameters | ) |

Set generator parameters.

Parameters

  parameters | normal distribution parameters and seed

Definition at line 174 of file random.hpp.

References pcl::common::NormalGenerator< T >::distribution_, pcl::common::NormalGenerator< T >::generator_, pcl::common::NormalGenerator< T >::Parameters::mean, pcl::common::NormalGenerator< T >::parameters_, pcl::common::NormalGenerator< T >::rng_, pcl::common::NormalGenerator< T >::Parameters::seed, and pcl::common::NormalGenerator< T >::Parameters::sigma.

## setSeed()

template<typename T >

void pcl::common::NormalGenerator< T >::setSeed | ( | pcl::uint32_t | seed | ) |

Change seed value.

Parameters

  [in] | seed | new seed value

Definition at line 144 of file random.hpp.

References pcl::common::NormalGenerator< T >::parameters_, pcl::common::NormalGenerator< T >::rng_, and pcl::common::NormalGenerator< T >::Parameters::seed.

## Member Data Documentation

## distribution_

template<typename T >

DistributionType pcl::common::NormalGenerator< T >::distribution_

normal distribution

Definition at line 222 of file random.h.

Referenced by pcl::common::NormalGenerator< T >::setParameters().

## generator_

template<typename T >

boost::variate_generator<EngineType&, DistributionType > pcl::common::NormalGenerator< T >::generator_

generator of random number from a normal distribution

Definition at line 226 of file random.h.

Referenced by pcl::common::NormalGenerator< T >::setParameters().

## parameters_

template<typename T >

Parameters pcl::common::NormalGenerator< T >::parameters_

parameters

Definition at line 220 of file random.h.

Referenced by pcl::common::NormalGenerator< T >::NormalGenerator(), pcl::common::NormalGenerator< T >::setParameters(), and pcl::common::NormalGenerator< T >::setSeed().

## rng_

template<typename T >

EngineType pcl::common::NormalGenerator< T >::rng_

random number generator

Definition at line 224 of file random.h.

Referenced by pcl::common::NormalGenerator< T >::NormalGenerator(), pcl::common::NormalGenerator< T >::setParameters(), and pcl::common::NormalGenerator< T >::setSeed().

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

- /build/pcl-qv3n_B/pcl-1.8.1+dfsg1/common/include/pcl/common/random.h
- /build/pcl-qv3n_B/pcl-1.8.1+dfsg1/common/include/pcl/common/impl/random.hpp