representation for streams of pseudorandom numbers More...
#include <Stream.hpp>
Public Types | |
typedef EngineType | engine_type |
typedef engine_type::state_type | state_type |
Engine type. More... | |
typedef engine_type::seed_type | seed_type |
Type of RNG state. More... | |
typedef engine_type::advance_type | advance_type |
Type of RNG seed. More... | |
typedef engine_type::init_type | init_type |
Type of RNG displacement. More... | |
typedef DistibutionType | distribution_type |
Type of RNG initializer. More... | |
typedef distribution_type::result_type | result_type |
type of the STL compliant distribution More... | |
typedef random_iterator_tbb::transform_iterator< caller_type, counting_iterator > | iterator |
type of the result More... | |
Public Member Functions | |
Stream ()=delete | |
type of stream iterator More... | |
Stream (distribution_type const &distribution, seed_type seed, uint32_t stream=0) | |
Constructor. More... | |
Stream (Stream< DistibutionType, EngineType > const &other) | |
Copy constructor. More... | |
iterator | begin () const |
Returns an iterator to the first element of the stream. More... | |
iterator | end () const |
Returns an iterator to the past last element of the stream. More... | |
result_type | operator[] (advance_type n) const |
Returns the element at specified location n. More... | |
result_type | operator() (void) |
At each call, this function will produce a pseudorandom number and advance the engine state. More... | |
distribution_type | getDistribution () const |
Get the distribution. More... | |
void | setDistribution (distribution_type dist) |
Set the distribution. More... | |
engine_type | getEngine () const |
Get the associated engine. More... | |
void | setEngine (engine_type engine) |
Set the object's engine. More... | |
const seed_type & | getSeed () const |
Get the seed. More... | |
void | setSeed (const seed_type &seed) |
Set the seed. More... | |
uint32_t | getStream () const |
Get the object's stream number. More... | |
void | setStream (uint32_t stream) |
Set the object's stream number. More... | |
Objects of this class represent collections of up to \( {2}^{32} \) streams of random numbers for each seed. Each of such streams has a length of \( {2}^{64} \). If the chosen distribution generates data with 64bits, like double
, then each stream can handle up to 128 ExaByte of data. Stream objects are thread-safe and lazy-evaluated. Output is produced only when requested. It is user responsibility to retrieve and store, if needed, the generated output.
DistibutionType | STL compliant distribution type. For example: std::uniform_real_distribution , std::exponential_distribution . |
EngineType | RNG type. |
There are seven options:
Usage:
1) Direct class instantiation:
2) Using random_iterator::make_stream(...)
:
Definition at line 116 of file Stream.hpp.
typedef engine_type::advance_type random_iterator::Stream< DistibutionType, EngineType >::advance_type |
Definition at line 126 of file Stream.hpp.
typedef DistibutionType random_iterator::Stream< DistibutionType, EngineType >::distribution_type |
Definition at line 129 of file Stream.hpp.
typedef EngineType random_iterator::Stream< DistibutionType, EngineType >::engine_type |
Definition at line 123 of file Stream.hpp.
typedef engine_type::init_type random_iterator::Stream< DistibutionType, EngineType >::init_type |
Definition at line 127 of file Stream.hpp.
typedef random_iterator_tbb::transform_iterator< caller_type, counting_iterator> random_iterator::Stream< DistibutionType, EngineType >::iterator |
Definition at line 132 of file Stream.hpp.
typedef distribution_type::result_type random_iterator::Stream< DistibutionType, EngineType >::result_type |
Definition at line 130 of file Stream.hpp.
typedef engine_type::seed_type random_iterator::Stream< DistibutionType, EngineType >::seed_type |
Definition at line 125 of file Stream.hpp.
typedef engine_type::state_type random_iterator::Stream< DistibutionType, EngineType >::state_type |
Definition at line 124 of file Stream.hpp.
|
delete |
|
inline |
distribution | Distribution with stl compliant interface. |
seed | Seed for pseudorandom number generation. |
stream | Pseudorandom number stream. |
Definition at line 143 of file Stream.hpp.
|
inline |
other |
Definition at line 155 of file Stream.hpp.
|
inline |
Definition at line 166 of file Stream.hpp.
|
inline |
Definition at line 178 of file Stream.hpp.
|
inline |
Definition at line 214 of file Stream.hpp.
|
inline |
Definition at line 232 of file Stream.hpp.
|
inline |
Definition at line 250 of file Stream.hpp.
|
inline |
Definition at line 268 of file Stream.hpp.
|
inline |
DistributionType
Definition at line 204 of file Stream.hpp.
|
inline |
No bounds checking is performed.
n | position in the sequence. |
Definition at line 192 of file Stream.hpp.
|
inline |
dist |
Definition at line 223 of file Stream.hpp.
|
inline |
engine |
Definition at line 241 of file Stream.hpp.
|
inline |
seed |
Definition at line 259 of file Stream.hpp.
|
inline |
stream |
Definition at line 277 of file Stream.hpp.