Point Cloud Library (PCL)  1.14.1-dev
List of all members | Classes | Public Member Functions
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 each 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, std::uint32_t seed=-1)
 Constructor. More...
 
 UniformGenerator (const Parameters &parameters)
 Constructor. More...
 
void setSeed (std::uint32_t seed)
 Change seed value. More...
 
void setParameters (T min, T max, std::uint32_t seed=-1)
 Set the uniform number generator parameters. More...
 
void setParameters (const Parameters &parameters)
 Set generator parameters. More...
 
const ParametersgetParameters ()
 
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 each number within [min, max] has almost the same probability of being drawn.

Author
Nizar Sallem

Definition at line 78 of file random.h.

Constructor & Destructor Documentation

◆ UniformGenerator() [1/2]

template<typename T >
pcl::common::UniformGenerator< T >::UniformGenerator ( min = 0,
max = 1,
std::uint32_t  seed = -1 
)

Constructor.

Parameters
minincluded lower bound
maxincluded higher bound
seedseeding value

Definition at line 53 of file random.hpp.

◆ UniformGenerator() [2/2]

template<typename T >
pcl::common::UniformGenerator< T >::UniformGenerator ( const Parameters parameters)

Constructor.

Parameters
parametersuniform distribution parameters and generator seed

Definition at line 63 of file random.hpp.

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

Member Function Documentation

◆ getParameters()

template<typename T >
const Parameters& pcl::common::UniformGenerator< T >::getParameters ( )
inline
Returns
uniform distribution parameters and generator seed

Definition at line 128 of file random.h.

◆ run()

template<typename T >
T pcl::common::UniformGenerator< T >::run ( )
inline
Returns
a randomly generated number in the interval [min, max]

Definition at line 132 of file random.h.

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

◆ setParameters() [1/2]

template<typename T >
void pcl::common::UniformGenerator< T >::setParameters ( const Parameters parameters)

Set generator parameters.

Parameters
parametersuniform distribution parameters and generator seed

Definition at line 101 of file random.hpp.

◆ setParameters() [2/2]

template<typename T >
void pcl::common::UniformGenerator< T >::setParameters ( min,
max,
std::uint32_t  seed = -1 
)

Set the uniform number generator parameters.

Parameters
[in]minminimum allowed value
[in]maxmaximum allowed value
[in]seedrandom number generator seed (applied if != -1)

Definition at line 84 of file random.hpp.

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

◆ setSeed()

template<typename T >
void pcl::common::UniformGenerator< T >::setSeed ( std::uint32_t  seed)

Change seed value.

Parameters
[in]seednew generator seed value

Definition at line 73 of file random.hpp.


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