Class TempLat::RandomUniform
template <typename T, typename RNG>
ClassList > TempLat > RandomUniform
A class which gives pseudo random counter-based rng, based on a string random seed, stable across platforms. More...
#include <randomuniform.h>
Public Types
| Type | Name |
|---|---|
| typedef INT | IntegerType |
Public Functions
| Type | Name |
|---|---|
| RandomUniform (const std::string & stringSeed) |
|
| DEVICE_INLINE_FUNCTION T | get (INT r, INT c, INT gen) const |
| DEVICE_INLINE_FUNCTION device::array< T, 2 > | getPair (INT r, INT c, INT gen) const |
| auto | getSeed () const |
| const std::string & | getSeedString () const |
| DEVICE_INLINE_FUNCTION T | integer_to_float (R value) const |
| void | loadState (const std::string & state) Restores RNG state from a serialized string. |
| std::string | saveState () const Serializes the complete RNG state to a string. |
Detailed Description
Unit test: ctest -R test-randomuniform
Public Types Documentation
typedef IntegerType
Public Functions Documentation
function RandomUniform
function get
function getPair
inline DEVICE_INLINE_FUNCTION device::array< T, 2 > TempLat::RandomUniform::getPair (
INT r,
INT c,
INT gen
) const
function getSeed
function getSeedString
function integer_to_float
template<typename R>
inline DEVICE_INLINE_FUNCTION T TempLat::RandomUniform::integer_to_float (
R value
) const
function loadState
Restores RNG state from a serialized string.
Parameters:
stateString produced by saveState()
function saveState
Serializes the complete RNG state to a string.
Returns:
String containing serialized mt19937_64 state and counter
Friends Documentation
friend operator<<
inline std::ostream & TempLat::RandomUniform::operator<< (
std::ostream & ostream,
const RandomUniform & pr
)
friend operator==
For testing purposes, we need to compare prng's, specifically their seeds.
The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/util/random/randomuniform.h