40 #ifndef PCL_COMMON_RANDOM_H_
41 #define PCL_COMMON_RANDOM_H_
44 #pragma GCC system_header
47 #include <boost/random/uniform_real.hpp>
48 #include <boost/random/uniform_int.hpp>
49 #include <boost/random/variate_generator.hpp>
50 #include <boost/random/normal_distribution.hpp>
51 #include <boost/random/mersenne_twister.hpp>
52 #include <pcl/pcl_macros.h>
64 typedef boost::uniform_int<int>
type;
70 typedef boost::uniform_real<float>
type;
76 typedef boost::normal_distribution<T>
type;
91 Parameters (T _min = 0, T _max = 1, pcl::uint32_t _seed = 1)
140 run () {
return (generator_ ()); }
143 typedef boost::mt19937 EngineType;
146 Parameters parameters_;
148 DistributionType distribution_;
152 boost::variate_generator<EngineType&, DistributionType> generator_;
166 Parameters (T _mean = 0, T _sigma = 1, pcl::uint32_t _seed = 1)
226 boost::variate_generator<EngineType&, DistributionType >
generator_;
231 #include <pcl/common/impl/random.hpp>
NormalGenerator(T mean=0, T sigma=1, pcl::uint32_t seed=-1)
Constructor.
NormalGenerator class generates a random number from a normal distribution specified by (mean...
void setSeed(pcl::uint32_t seed)
Change seed value.
void setParameters(T mean, T sigma, pcl::uint32_t seed=-1)
Set the normal number generator parameters.
Parameters parameters_
parameters
void setParameters(T min, T max, pcl::uint32_t seed=-1)
Set the uniform number generator parameters.
EngineType rng_
random number generator
boost::variate_generator< EngineType &, DistributionType > generator_
generator of random number from a normal distribution
Parameters(T _mean=0, T _sigma=1, pcl::uint32_t _seed=1)
boost::mt19937 EngineType
const Parameters & getParameters()
normal_distribution< T >::type DistributionType
uniform distribution dummy struct
Parameters(T _min=0, T _max=1, pcl::uint32_t _seed=1)
UniformGenerator class generates a random number from range [min, max] at each run picked according t...
boost::uniform_real< float > type
UniformGenerator(T min=0, T max=1, pcl::uint32_t seed=-1)
Constructor.
DistributionType distribution_
normal distribution
boost::normal_distribution< T > type
boost::uniform_int< int > type
void setSeed(pcl::uint32_t seed)
Change seed value.
const Parameters & getParameters()