40 value.component(cmpt) = scalar01();
53 value.component(cmpt) = GaussNormal<scalar>();
66 value.component(cmpt) +=
67 scalar01()*(
end.component(cmpt) - start.component(cmpt));
77 value = sample01<Type>();
84 for (label posi =
values.size()-1; posi > 0; --posi)
86 const label i = position<label>(0, posi);
99 value = sample01<Type>();
115 value = GaussNormal<Type>();
131 value = position<Type>(start,
end);
145 value = sample01<Type>();
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...
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-paral...
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].
Type globalPosition(const Type &start, const Type &end)
Return a sample on the interval [start,end].
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
void globalRandomise01(Type &value)
Randomise value in the range 0-1.
Type globalSample01()
Return a sample whose components lie in the range [0,1].
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
Exchange contents of lists - see DynamicList::swap().
Type GaussNormal()
Return a sample whose components are normally distributed with zero mean and unity variance N(0...
Type position(const Type &start, const Type &end)
Return a sample on the interval [start,end].
static constexpr const zero Zero
Global zero (0)