Point Cloud Library (PCL) 1.12.1
Loading...
Searching...
No Matches
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>

Collaboration diagram for pcl::common::NormalGenerator< T >:

Classes

struct  Parameters

Public Types

using DistributionType = typename normal_distribution<T>::type

Public Member Functions

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

Public Attributes

Parameters parameters_
 parameters
std::mt19937 rng_
 random number generator
DistributionType distribution_
 normal distribution

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 150 of file random.h.

Member Typedef Documentation

◆ DistributionType

template<typename T>
using pcl::common::NormalGenerator< T >::DistributionType = typename normal_distribution<T>::type

Definition at line 206 of file random.h.

Constructor & Destructor Documentation

◆ NormalGenerator() [1/2]

template<typename T>
pcl::common::NormalGenerator< T >::NormalGenerator ( T mean = 0,
T sigma = 1,
std::uint32_t seed = -1 )

Constructor.

Parameters
[in]meannormal mean
[in]sigmanormal variation
[in]seedseeding value

Definition at line 113 of file random.hpp.

References distribution_, parameters_, and rng_.

◆ NormalGenerator() [2/2]

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

Constructor.

Parameters
parametersnormal distribution parameters and seed

Definition at line 123 of file random.hpp.

References distribution_, parameters_, and rng_.

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 200 of file random.h.

References parameters_.

◆ 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 204 of file random.h.

References distribution_, and rng_.

◆ setParameters() [1/2]

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

Set generator parameters.

Parameters
parametersnormal distribution parameters and seed

Definition at line 158 of file random.hpp.

References distribution_, parameters_, and rng_.

◆ setParameters() [2/2]

template<typename T>
void pcl::common::NormalGenerator< T >::setParameters ( T mean,
T sigma,
std::uint32_t seed = -1 )

Set the normal number generator parameters.

Parameters
[in]meanmean of the normal distribution
[in]sigmastandard variation of the normal distribution
[in]seedrandom number generator seed (applied if != -1)

Definition at line 144 of file random.hpp.

References distribution_, parameters_, and rng_.

◆ setSeed()

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

Change seed value.

Parameters
[in]seednew seed value

Definition at line 133 of file random.hpp.

References parameters_, and rng_.

Member Data Documentation

◆ distribution_

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

normal distribution

Definition at line 212 of file random.h.

Referenced by NormalGenerator(), NormalGenerator(), run(), setParameters(), and setParameters().

◆ parameters_

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

parameters

Definition at line 208 of file random.h.

Referenced by getParameters(), NormalGenerator(), NormalGenerator(), setParameters(), setParameters(), and setSeed().

◆ rng_

template<typename T>
std::mt19937 pcl::common::NormalGenerator< T >::rng_

random number generator

Definition at line 210 of file random.h.

Referenced by NormalGenerator(), NormalGenerator(), run(), setParameters(), setParameters(), and setSeed().


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