30 inline Foam::Random::type Foam::Random::sample()
42 x_((type(
s) << 16) + 0x330E),
43 scalarNormalStored_(false),
58 return scalar(sample())/(
M >> 17);
64 return a + scalar01()*(
b - a);
73 for (
direction i = 0; i < pTraits<Type>::nComponents; ++ i)
75 value.component(i) = scalar01();
106 return scalarAB(a,
b);
113 return a + sample() % (
b - a);
122 for (
direction i = 0; i < pTraits<Type>::nComponents; ++ i)
124 value.component(i) = scalarNormal();
134 return scalarNormal();
138 template<
class Container>
141 for (
label i = 0; i < l.size(); ++ i)
143 Swap(l[i], l[sampleAB<label>(i, l.size())]);
scalar scalarAB(const scalar a, const scalar b)
Advance the state and return a scalar sample from a uniform.
scalar scalar01()
Advance the state and return a scalar sample from a uniform.
Type sample01()
Advance the state and return a sample of a given type from a.
void permute(Container &l)
Randomly permute a list.
Type sampleAB(const Type &a, const Type &b)
Advance the state and return a sample of a given type from a.
Type sampleNormal()
Advance the state and return a sample of a given type from a.
Random(const label s)
Construct from a seed.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)