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

UniformGenerator class generates a random number from range [min, max] at each run picked according to a uniform distribution i.e eaach number within [min, max] has almost the same probability of being drawn. More...

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

## Classes

struct | Parameters

## Public Member Functions

| UniformGenerator (T min=0, T max=1, pcl::uint32_t seed=-1)
| Constructor. More...
| UniformGenerator (const Parameters &parameters)
| Constructor. More...
void | setSeed (pcl::uint32_t seed)
| Change seed value. More...
void | setParameters (T min, T max, pcl::uint32_t seed=-1)
| Set the uniform number generator parameters. More...
void | setParameters (const Parameters &parameters)
| Set generator parameters. More...
const Parameters & | getParameters ()
T | run ()

## Detailed Description

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

UniformGenerator class generates a random number from range [min, max] at each run picked according to a uniform distribution i.e eaach number within [min, max] has almost the same probability of being drawn.

Author
  Nizar Sallem

Definition at line 86 of file random.h.

## Constructor & Destructor Documentation

template<typename T >

pcl::common::UniformGenerator< T >::UniformGenerator | ( | T | min = `0`,
|  | T | max = `1`,
|  | pcl::uint32_t | seed = `-1`
| ) |  |

Constructor.

Parameters

  min | included lower bound
  max | included higher bound
  seed | seeding value

Definition at line 48 of file random.hpp.

References pcl::common::UniformGenerator< T >::Parameters::seed.

template<typename T >

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

Constructor.

Parameters

  parameters | uniform distribution parameters and generator seed

Definition at line 60 of file random.hpp.

References pcl::common::UniformGenerator< T >::Parameters::seed.

## Member Function Documentation

template<typename T>

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

inline

Returns
  uniform distribution parameters and generator seed

Definition at line 136 of file random.h.

template<typename T>

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

inline

Returns
  a randomly generated number in the interval [min, max]

Definition at line 140 of file random.h.

Referenced by pcl::recognition::ModelLibrary::Model::Model().

template<typename T >

void pcl::common::UniformGenerator< T >::setParameters | ( | T | min,
|  | T | max,
|  | pcl::uint32_t | seed = `-1`
| ) |  |

Set the uniform number generator parameters.

Parameters

  [in] | min | minimum allowed value
  [in] | max | maximum allowed value
  [in] | seed | random number generator seed (applied if != -1)

Definition at line 82 of file random.hpp.

References pcl::common::UniformGenerator< T >::Parameters::max, pcl::common::UniformGenerator< T >::Parameters::min, and pcl::common::UniformGenerator< T >::Parameters::seed.

Referenced by pcl::recognition::ModelLibrary::Model::Model().

template<typename T >

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

Set generator parameters.

Parameters

  parameters | uniform distribution parameters and generator seed

Definition at line 104 of file random.hpp.

References pcl::common::UniformGenerator< T >::Parameters::max, pcl::common::UniformGenerator< T >::Parameters::min, and pcl::common::UniformGenerator< T >::Parameters::seed.

template<typename T >

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

Change seed value.

Parameters

  [in] | seed | new generator seed value

Definition at line 71 of file random.hpp.

References pcl::common::UniformGenerator< T >::Parameters::seed.

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

- /build/pcl-6_P28C/pcl-1.7.2/common/include/pcl/common/random.h
- /build/pcl-6_P28C/pcl-1.7.2/common/include/pcl/common/impl/random.hpp