54 template<
class T>
class UList;
71 std::uniform_real_distribution<scalar> uniform01_;
83 inline scalar scalar01();
113 inline label
seed()
const;
116 inline void reset(
const label seedValue);
171 scalar Random::sample01<scalar>();
174 label Random::sample01<label>();
177 scalar Random::GaussNormal<scalar>();
180 label Random::GaussNormal<label>();
183 scalar Random::position<scalar>(
const scalar& start,
const scalar&
end);
186 label Random::position<label>(
const label& start,
const label&
end);
189 scalar Random::globalSample01<scalar>();
192 label Random::globalSample01<label>();
195 scalar Random::globalGaussNormal<scalar>();
198 label Random::globalGaussNormal<label>();
201 scalar Random::globalPosition<scalar>(
const scalar& start,
const scalar&
end);
204 label Random::globalPosition<label>(
const label& start,
const label&
end);
233 .position<
T>(min_, max_);
void randomise01(Type &value)
Randomise value in the range [0,1].
Type globalGaussNormal()
Return a sample whose components are normally distributed with zero mean and unity variance N(0...
void reset(const label seedValue)
Reset the random number generator seed.
void shuffle(UList< Type > &values)
Shuffle the values in the list.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Type sample01()
Return a sample whose components lie in the range [0,1].
Random(const label seedValue=defaultSeed)
Construct with seed value.
Type globalPosition(const Type &start, const Type &end)
Return a sample on the interval [start,end].
A pseudo random number generator using the linear congruential algorithm with the following parameter...
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
T operator()()
Generate a random number.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void globalRandomise01(Type &value)
Randomise value in the range 0-1.
Type globalSample01()
Return a sample whose components lie in the range [0,1].
A generator class returning a gaussian distributed random number.
static constexpr label defaultSeed
The default seed value (name may change in the future)
Type GaussNormal()
Return a sample whose components are normally distributed with zero mean and unity variance N(0...
label seed() const
The initial random number seed that was used.
Type position(const Type &start, const Type &end)
Return a sample on the interval [start,end].
gaussianGeneratorOp(const label seed=Random::defaultSeed)
Default construct or with seed value. Uses default [0,1] interval.
int bit()
Return a random bit.