Simple random number generator. More...
Public Member Functions | |
Random (const label) | |
Construct given seed. More... | |
int | bit () |
scalar | scalar01 () |
Scalar [0..1] (so including 0,1) More... | |
vector | vector01 () |
Vector with every component scalar01. More... | |
sphericalTensor | sphericalTensor01 () |
sphericalTensor with every component scalar01 More... | |
symmTensor | symmTensor01 () |
symmTensor with every component scalar01 More... | |
tensor | tensor01 () |
Tensor with every component scalar01. More... | |
label | integer (const label lower, const label upper) |
Label [lower..upper]. More... | |
vector | position (const vector &, const vector &) |
void | randomise (scalar &) |
void | randomise (vector &) |
void | randomise (sphericalTensor &) |
void | randomise (symmTensor &) |
void | randomise (tensor &) |
scalar | GaussNormal () |
Return a normal Gaussian randon number. More... | |
Simple random number generator.
Construct given seed.
Definition at line 39 of file Random.C.
References Foam::osRandomSeed().
int bit | ( | ) |
Definition at line 54 of file Random.C.
References Foam::osRandomInteger().
Foam::scalar scalar01 | ( | ) |
Scalar [0..1] (so including 0,1)
Definition at line 67 of file Random.C.
References Foam::osRandomDouble().
Referenced by Random::GaussNormal(), conformalVoronoiMesh::maxSurfaceProtrusion(), Random::position(), Random::randomise(), triangle< Point, PointRef >::randomPoint(), tetrahedron< Point, PointRef >::randomPoint(), Random::sphericalTensor01(), Random::symmTensor01(), Random::tensor01(), turbGen::U(), and Random::vector01().
Foam::vector vector01 | ( | ) |
Vector with every component scalar01.
Definition at line 73 of file Random.C.
References VectorSpace< Form, Cmpt, Ncmpts >::component(), VectorSpace< Vector< scalar >, scalar, 3 >::nComponents, and Random::scalar01().
Referenced by treeBoundBox::extend(), Random::randomise(), and turbGen::U().
Foam::sphericalTensor sphericalTensor01 | ( | ) |
sphericalTensor with every component scalar01
Definition at line 85 of file Random.C.
References SphericalTensor< Cmpt >::ii(), and Random::scalar01().
Referenced by Random::randomise().
Foam::symmTensor symmTensor01 | ( | ) |
symmTensor with every component scalar01
Definition at line 94 of file Random.C.
References VectorSpace< Form, Cmpt, Ncmpts >::component(), VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::nComponents, and Random::scalar01().
Referenced by Random::randomise().
Foam::tensor tensor01 | ( | ) |
Tensor with every component scalar01.
Definition at line 106 of file Random.C.
References VectorSpace< Form, Cmpt, Ncmpts >::component(), VectorSpace< Tensor< scalar >, scalar, Mrows *Ncols >::nComponents, and Random::scalar01().
Referenced by Random::randomise().
Foam::label integer | ( | const label | lower, |
const label | upper | ||
) |
Label [lower..upper].
Definition at line 118 of file Random.C.
References Foam::osRandomInteger().
Referenced by randomRenumber::renumber().
Foam::vector position | ( | const vector & | start, |
const vector & | end | ||
) |
Definition at line 124 of file Random.C.
References VectorSpace< Form, Cmpt, Ncmpts >::component(), VectorSpace< Vector< scalar >, scalar, 3 >::nComponents, and Random::scalar01().
void randomise | ( | scalar & | s | ) |
Definition at line 138 of file Random.C.
References Random::scalar01().
void randomise | ( | vector & | v | ) |
Definition at line 144 of file Random.C.
References Random::vector01().
void randomise | ( | sphericalTensor & | st | ) |
Definition at line 150 of file Random.C.
References Random::sphericalTensor01().
void randomise | ( | symmTensor & | st | ) |
Definition at line 156 of file Random.C.
References Random::symmTensor01().
void randomise | ( | tensor & | t | ) |
Definition at line 162 of file Random.C.
References Random::tensor01().
Foam::scalar GaussNormal | ( | ) |
Return a normal Gaussian randon number.
with zero mean and unity variance N(0, 1)
Definition at line 168 of file Random.C.
References Foam::log(), Random::scalar01(), Foam::sqr(), and Foam::sqrt().