Go to the documentation of this file.
38 hasGaussSample_(false),
46 generator_(r.generator_),
48 hasGaussSample_(r.hasGaussSample_),
49 gaussSample_(r.gaussSample_)
53 hasGaussSample_ =
false;
55 generator_.
seed(seed_);
72 return round(scalar01());
81 hasGaussSample_ =
false;
91 v1 = 2*scalar01() - 1;
92 v2 = 2*scalar01() - 1;
94 }
while (rsq >= 1 || rsq == 0);
98 gaussSample_ = v1*
fac;
99 hasGaussSample_ =
true;
108 return round(GaussNormal<scalar>());
130 <<
"start index " <<
start <<
" > end index " <<
end <<
nl
150 scalar value(-GREAT);
170 value = round(scalar01());
182 scalar value(-GREAT);
186 value = GaussNormal<scalar>();
202 value = GaussNormal<label>();
218 scalar value(-GREAT);
222 value = position<scalar>(
start,
end);
242 value = position<label>(
start,
end);
Type globalSample01()
Return a sample whose components lie in the range [0,1].
label ListType::const_reference val
Type sample01()
Return a sample whose components lie in the range [0,1].
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
Random(const label seedValue=defaultSeed)
Construct with seed value.
void reset(const label seedValue)
Reset the random number generator seed.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void seed(uint32_t val=default_seed)
Reseed the generator.
dimensionedScalar log(const dimensionedScalar &ds)
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
errorManip< error > abort(error &err)
Calculate the second temporal derivative.
Inter-processor communication reduction functions.
static bool master(const label communicator=0)
Am I the master process.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Type position(const Type &start, const Type &end)
Return a sample on the interval [start,end].
dimensionedScalar sqrt(const dimensionedScalar &ds)
label ListType::const_reference const label start
Type globalPosition(const Type &start, const Type &end)
Return a sample on the interval [start,end].