|
PSCF v1.5.0
|
Random number generator for arrays of random numbers on CPU. More...
#include <VecRandom.h>
Public Member Functions | |
| VecRandom () | |
| Default constructor. | |
| VecRandom (Util::Random &random) | |
| Constructor - creates association with a scalar RNG. | |
| ~VecRandom () | |
| Destructor. | |
| void | associate (Util::Random &random) |
| Create an association with a Util::Random scalar RNG. | |
| void | uniform (Util::Array< double > &data) |
| Generate uniform random doubles in (0, 1]. | |
| void | uniform (Util::Array< double > &data, double min, double max) |
| Generate uniform random distribution in range (min, max]. | |
| void | normal (Util::Array< double > &data, double stddev, double mean=0.0) |
| Generate normal-distributed random doubles. | |
Random number generator for arrays of random numbers on CPU.
A VecRandom<CPT> generates arrays of random real numbers on a CPU. It uses an associated Util::Random scalar random number generator to generate these random numbers.
Definition at line 43 of file cpp/VecRandom.h.
| Pscf::VecRandom< CPT >::VecRandom | ( | ) |
Default constructor.
Definition at line 13 of file VecRandom.cpp.
References VecRandom().
Referenced by associate(), normal(), uniform(), uniform(), VecRandom(), VecRandom(), and ~VecRandom().
| Pscf::VecRandom< CPT >::VecRandom | ( | Util::Random & | random | ) |
Constructor - creates association with a scalar RNG.
| random | associated scalar random number generator (RNG) |
Definition at line 20 of file VecRandom.cpp.
References VecRandom().
| Pscf::VecRandom< CPT >::~VecRandom | ( | ) |
| void Pscf::VecRandom< CPT >::associate | ( | Util::Random & | random | ) |
Create an association with a Util::Random scalar RNG.
| random | associated scalar random number generator |
Definition at line 33 of file VecRandom.cpp.
References VecRandom().
| void Pscf::VecRandom< CPT >::uniform | ( | Util::Array< double > & | data | ) |
Generate uniform random doubles in (0, 1].
| data | array to populate |
Definition at line 39 of file VecRandom.cpp.
References Util::Array< Data >::capacity(), UTIL_CHECK, and VecRandom().
| void Pscf::VecRandom< CPT >::uniform | ( | Util::Array< double > & | data, |
| double | min, | ||
| double | max ) |
Generate uniform random distribution in range (min, max].
| data | array to populate with random numbers |
| min | minimum of range |
| max | maximum of range |
Definition at line 52 of file VecRandom.cpp.
References Util::Array< Data >::capacity(), UTIL_CHECK, and VecRandom().
| void Pscf::VecRandom< CPT >::normal | ( | Util::Array< double > & | data, |
| double | stddev, | ||
| double | mean = 0.0 ) |
Generate normal-distributed random doubles.
| data | array to populate |
| stddev | standard deviation (input) |
| mean | mean value (input, default = 0.0) |
Definition at line 66 of file VecRandom.cpp.
References Util::Array< Data >::capacity(), UTIL_CHECK, and VecRandom().