Random::gaussianGeneratorOp< T > Class Template Reference

A generator class returning a gaussian distributed random number. More...

Inheritance diagram for Random::gaussianGeneratorOp< T >:
[legend]
Collaboration diagram for Random::gaussianGeneratorOp< T >:
[legend]

Public Member Functions

 gaussianGeneratorOp (const label seed=Random::defaultSeed)
 Default construct or with seed value. Uses default [0,1] interval. More...
 
T operator() ()
 Generate a random number. More...
 
template<class U >
T operator() (const U &) const
 
- Public Member Functions inherited from Random
 Random (const label seedValue=defaultSeed)
 Construct with seed value. More...
 
 Random (const Random &rnd, const bool reset)
 Copy construct with possible reset of seed. More...
 
label seed () const
 The initial random number seed that was used. More...
 
void reset (const label seedValue)
 Reset the random number generator seed. More...
 
int bit ()
 Return a random bit. More...
 
template<class Type >
Type sample01 ()
 Return a sample whose components lie in the range [0,1]. More...
 
template<class Type >
Type GaussNormal ()
 
template<class Type >
Type position (const Type &start, const Type &end)
 Return a sample on the interval [start,end]. More...
 
template<class Type >
void randomise01 (Type &value)
 Randomise value in the range [0,1]. More...
 
template<class Type >
void shuffle (UList< Type > &values)
 Shuffle the values in the list. More...
 
template<class Type >
Type globalSample01 ()
 Return a sample whose components lie in the range [0,1]. More...
 
template<class Type >
Type globalGaussNormal ()
 
template<class Type >
Type globalPosition (const Type &start, const Type &end)
 Return a sample on the interval [start,end]. More...
 
template<class Type >
void globalRandomise01 (Type &value)
 Randomise value in the range 0-1. More...
 
template<>
Foam::scalar sample01 ()
 
template<>
Foam::scalar GaussNormal ()
 
template<>
Foam::scalar position (const scalar &start, const scalar &end)
 
template<>
Foam::label position (const label &start, const label &end)
 
template<>
Foam::scalar globalSample01 ()
 
template<>
Foam::scalar globalGaussNormal ()
 
template<>
Foam::scalar globalPosition (const scalar &start, const scalar &end)
 
template<>
Foam::label globalPosition (const label &start, const label &end)
 
template<>
scalar sample01 ()
 
template<>
label sample01 ()
 
template<>
scalar GaussNormal ()
 
template<>
label GaussNormal ()
 
template<>
scalar position (const scalar &start, const scalar &end)
 
template<>
label position (const label &start, const label &end)
 
template<>
scalar globalSample01 ()
 
template<>
label globalSample01 ()
 
template<>
scalar globalGaussNormal ()
 
template<>
label globalGaussNormal ()
 
template<>
scalar globalPosition (const scalar &start, const scalar &end)
 
template<>
label globalPosition (const label &start, const label &end)
 

Additional Inherited Members

- Static Public Attributes inherited from Random
static constexpr label defaultSeed = 123456
 The default seed value (name may change in the future) More...
 

Detailed Description

template<class T>
class Foam::Random::gaussianGeneratorOp< T >

A generator class returning a gaussian distributed random number.

See also
std::generate()

Definition at line 287 of file Random.H.

Constructor & Destructor Documentation

◆ gaussianGeneratorOp()

gaussianGeneratorOp ( const label  seed = Random::defaultSeed)
inlineexplicit

Default construct or with seed value. Uses default [0,1] interval.

Definition at line 306 of file Random.H.

Member Function Documentation

◆ operator()() [1/2]

T operator() ( )
inline

Generate a random number.

Definition at line 315 of file Random.H.

◆ operator()() [2/2]

T operator() ( const U ) const
inline

Ignore parameter and generate a random number, which allows it to be used as a replacement for general unary operators.

Definition at line 323 of file Random.H.


The documentation for this class was generated from the following file: