Random::uniformGeneratorOp< T > Class Template Reference

Public Member Functions

 uniformGeneratorOp (const label seed=Random::defaultSeed)
 Default construct or with seed value. Uses default [0,1] interval. More...
 
 uniformGeneratorOp (const T &minval, const T &maxval)
 Construct with specified interval, using default seed. More...
 
 uniformGeneratorOp (const label seed, const T &minval, const T &maxval)
 Construct with seed value and specified interval. More...
 
T operator() ()
 Generate a random number. More...
 
template<class U >
T operator() (const U &) const
 

Detailed Description

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

A generator class returning a uniformly distributed random number on the given interval.

See also
std::generate()

Definition at line 88 of file Random.H.

Constructor & Destructor Documentation

◆ uniformGeneratorOp() [1/3]

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

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

Definition at line 241 of file Random.H.

◆ uniformGeneratorOp() [2/3]

uniformGeneratorOp ( const T minval,
const T maxval 
)
inline

Construct with specified interval, using default seed.

Definition at line 247 of file Random.H.

◆ uniformGeneratorOp() [3/3]

uniformGeneratorOp ( const label  seed,
const T minval,
const T maxval 
)
inline

Construct with seed value and specified interval.

Definition at line 253 of file Random.H.

Member Function Documentation

◆ operator()() [1/2]

T operator() ( )
inline

Generate a random number.

Definition at line 264 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 272 of file Random.H.


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