Go to the documentation of this file.
39 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
41 value.component(cmpt) = scalar01();
52 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
54 value.component(cmpt) = GaussNormal<scalar>();
65 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
67 value.component(cmpt) +=
68 scalar01()*(
end.component(cmpt) - start.component(cmpt));
78 value = sample01<Type>();
85 for (label posi =
values.size()-1; posi > 0; --posi)
87 const label i = position<label>(0, posi);
100 value = sample01<Type>();
116 value = GaussNormal<Type>();
132 value = position<Type>(start,
end);
148 value = sample01<Type>();
Type globalSample01()
Return a sample whose components lie in the range [0,1].
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].
void shuffle(UList< Type > &values)
Shuffle the values in the list.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
void randomise01(Type &value)
Randomise value in the range [0,1].
void Swap(DynamicList< T, SizeMin1 > &a, DynamicList< T, SizeMin2 > &b)
Swap arguments as per std::swap, but in Foam namespace.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
static bool master(const label communicator=0)
Am I the master process.
void globalRandomise01(Type &value)
Randomise value in the range 0-1.
Type position(const Type &start, const Type &end)
Return a sample on the interval [start,end].
Traits class for primitives.
Type globalPosition(const Type &start, const Type &end)
Return a sample on the interval [start,end].