![]() |
ModelSpace
|
Class to generate random numbers according to uniform distribution. More...
#include <UniformRandom.hpp>
Public Member Functions | |
UniformRandom (T set_min, T set_max, unsigned int seed=0) | |
Constructor for the normal random distribution. | |
T | operator() () |
Public Attributes | |
clockwerk::DataIO< T > | min = clockwerk::DataIO<T>(this, "min") |
The mean of the random output. Can be get/set. | |
clockwerk::DataIO< T > | max = clockwerk::DataIO<T>(this, "max") |
The standard deviation of the random output. Can be get/set. | |
Protected Attributes | |
std::mt19937 | _engine |
std::uniform_real_distribution< double > | _distribution |
Class to generate random numbers according to uniform distribution.
This function generates a random uniform distribution draw according to the mt19937 engine and a std::uniform_distribution. It produces random numbers according to the min, max, and seed set in the constructor. Min and max may be modified via standard setters mean and std.
If numbers are entered backwards, will flip them
modelspace::UniformRandom< T >::UniformRandom | ( | T | set_min, |
T | set_max, | ||
unsigned int | seed = 0 |
||
) |
Constructor for the normal random distribution.
set_min | The minimum value in the distribution |
set_max | The maximum value in the distribution |
seed | Seed for the RNG – Defaults to zero |