Go to the documentation of this file.
17 #ifndef GZ_MATH_RAND_HH_
18 #define GZ_MATH_RAND_HH_
24 #include <gz/math/config.hh>
31 inline namespace IGNITION_MATH_VERSION_NAMESPACE {
48 class IGNITION_MATH_VISIBLE
Rand
53 public:
static void Seed(
unsigned int _seed);
58 public:
static unsigned int Seed();
63 public:
static double DblUniform(
double _min = 0,
double _max = 1);
68 public:
static double DblNormal(
double _mean = 0,
double _sigma = 1);
73 public:
static int32_t IntUniform(
int _min,
int _max);
78 public:
static int32_t IntNormal(
int _mean,
int _sigma);
82 private:
static uint32_t &SeedMutable();
std::uniform_real_distribution< double > UniformRealDist
Definition: gz/math/Rand.hh:38
Definition: gz/math/AdditivelySeparableScalarField3.hh:27
std::mt19937 GeneratorType
Definition: gz/math/Rand.hh:35
std::normal_distribution< double > NormalRealDist
Definition: gz/math/Rand.hh:41
std::uniform_int_distribution< int32_t > UniformIntDist
Definition: gz/math/Rand.hh:44
static int32_t IntNormal(int _mean, int _sigma)
Get an integer from a normal distribution.
static unsigned int Seed()
Get the seed value.
static int32_t IntUniform(int _min, int _max)
Get an integer from a uniform distribution.
Random number generator class.
Definition: gz/math/Rand.hh:48
static double DblNormal(double _mean=0, double _sigma=1)
Get a double from a normal distribution.
static double DblUniform(double _min=0, double _max=1)
Get a double from a uniform distribution.