#include <sampler.h>
Definition at line 79 of file sampler.h.
static double g2o::Sampler::gaussRand |
( |
double |
mean, |
|
|
double |
sigma |
|
) |
| |
|
inlinestatic |
Gaussian random with a mean and standard deviation. Uses the Polar method of Marsaglia.
Definition at line 86 of file sampler.h.
Referenced by main().
93 }
while (r2 > 1.0 || r2 == 0.0);
94 return mean + sigma * y * std::sqrt(-2.0 * log(r2) / r2);
static double uniformRand(double lowerBndr, double upperBndr)
static void g2o::Sampler::seedRand |
( |
| ) |
|
|
inlinestatic |
default seed function using the current time in seconds
Definition at line 107 of file sampler.h.
Referenced by main().
109 seedRand(static_cast<unsigned int>(std::time(NULL)));
static void g2o::Sampler::seedRand |
( |
unsigned int |
seed | ) |
|
|
inlinestatic |
seed the random number generator
Definition at line 113 of file sampler.h.
static double g2o::Sampler::uniformRand |
( |
double |
lowerBndr, |
|
|
double |
upperBndr |
|
) |
| |
|
inlinestatic |
sample a number from a uniform distribution
Definition at line 100 of file sampler.h.
Referenced by main().
102 return lowerBndr + ((double) std::rand() / (RAND_MAX + 1.0)) * (upperBndr - lowerBndr);
The documentation for this class was generated from the following file:
- /home/xuezhisd/CLionProjects/g2o/g2o/stuff/sampler.h