35 MersenneTwister(
const size_t seedValue,
const double start,
const double end);
41 void setSeed(
const size_t seedValue)
override;
43 void setRange(
const double start,
const double end)
override;
46 inline double nextValue()
override {
return uniformRealDistribution(m_engine); }
48 inline double nextValue(
double start,
double end)
override {
49 return std::uniform_real_distribution<double>(start, end)(m_engine);
52 int nextInt(
int start,
int end)
override;
54 void restart()
override;
59 void restore()
override;
61 double min()
const override {
return m_start; }
63 double max()
const override {
return m_end; }
This implements the the Mersenne Twister 19937 pseudo-random number generator algorithm as a specialz...
std::uniform_real_distribution< double > uniformRealDistribution
Uniform Real distribution.
double m_end
Maximum in range.
MersenneTwister & operator=(const MersenneTwister &)=delete
MersenneTwister(const MersenneTwister &)=delete
double m_start
Minimum in range.
double nextValue() override
Generate the next random number in the sequence within the given range default range.
double min() const override
Return the minimum value of the range.
std::mt19937::result_type m_seed
The current seed.
std::mt19937 m_engine
The engine.
double max() const override
Return the maximum value of the range.
std::unique_ptr< std::mt19937 > m_savedEngine
A generator that will take the value when save is requested.
double nextValue(double start, double end) override
Generate the next random number in the sequence within the given range.
Defines a 1D pseudo-random number generator, i.e.
Helper class which provides the Collimation Length for SANS instruments.