|
Stride Reference Manual
- generated for commit 9643b11
|
Manages random number generation in parallel (OpenMP) calculations. More...
#include <Rn.h>


Public Types | |
| using | EngineType = E |
| using | RnType = randutils::random_generator< E, randutils::seed_seq_fe128 > |
| using | ContainerType = std::vector< randutils::random_generator< E, randutils::seed_seq_fe128 >> |
Public Member Functions | |
| Rn () | |
| Default constructor build empty manager. More... | |
| Rn (const RnInfo &info) | |
| Initializes. More... | |
| Rn (const Rn &)=delete | |
| No copying. More... | |
| Rn & | operator= (const Rn &)=delete |
| No copy assignment. More... | |
| bool | operator== (const Rn &other) |
| Equality of states. More... | |
| RnInfo | GetInfo () const |
| Return the state of the random engines. More... | |
| std::function< double()> | GetUniform01Generator (unsigned int i=0U) |
| Return a generator for uniform doubles in [0, 1[ using i-th random engine. More... | |
| std::function< int()> | GetUniformIntGenerator (int a, int b, unsigned int i=0U) |
| Return a generator for uniform ints in [a, b[ (a < b) using i-th random engine. More... | |
| template<typename It > | |
| std::function< int()> | GetDiscreteGenerator (It begin, It end, unsigned int i=0U) |
| Return generator for integers [0, n-1[ with non-negative weights p_j (i=0,..,n-1) using i-th random engine. More... | |
| void | Initialize (const RnInfo &info) |
| Initalize with data in Info. More... | |
| bool | IsEmpty () const |
| Is this een empty (i.e. non-initialized Rn)? More... | |
| void | Shuffle (std::vector< unsigned int > &indices, unsigned int i) |
| Random shuffle of vector of unsigned int indices using i-th engine. More... | |
Private Member Functions | |
| void | Seed (randutils::seed_seq_fe128 &seseq) |
| Actual first-time seeding. Procedure varies according to engine type, see specialisations. More... | |
| template<> | |
| void | Seed (randutils::seed_seq_fe128 &seseq) |
| template<> | |
| void | Seed (randutils::seed_seq_fe128 &seseq) |
Private Attributes | |
| std::string | m_seed_seq_init |
| Seed sequence initializer used with engines. More... | |
| unsigned int | m_stream_count |
| Number of threads/streams set up with the engine. More... | |
Manages random number generation in parallel (OpenMP) calculations.
| using stride::util::Rn< E >::EngineType = E |
| using stride::util::Rn< E >::RnType = randutils::random_generator<E, randutils::seed_seq_fe128> |
| using stride::util::Rn< E >::ContainerType = std::vector<randutils::random_generator<E, randutils::seed_seq_fe128>> |
|
inline |
Default constructor build empty manager.
Definition at line 55 of file Rn.h.
Referenced by stride::util::Rn< pcg64 >::Rn().

|
inlineexplicit |
|
delete |
No copying.
|
delete |
No copy assignment.
Referenced by stride::util::Rn< pcg64 >::Rn().

| bool stride::util::Rn< E >::operator== | ( | const Rn< E > & | other | ) |
Equality of states.
Definition at line 36 of file Rn.cpp.
References stride::util::Rn< E >::m_stream_count.
Referenced by stride::util::Rn< pcg64 >::Rn().

| RnInfo stride::util::Rn< E >::GetInfo | ( | ) | const |
Return the state of the random engines.
Definition at line 48 of file Rn.cpp.
References stride::util::RnInfo::m_seed_seq_init, stride::util::RnInfo::m_state, and stride::util::RnInfo::m_stream_count.
Referenced by stride::util::Rn< pcg64 >::Rn().

|
inline |
|
inline |
|
inline |
| void stride::util::Rn< E >::Initialize | ( | const RnInfo & | info | ) |
Initalize with data in Info.
Definition at line 62 of file Rn.cpp.
References stride::util::CheckAllDigits(), stride::util::RnInfo::m_seed_seq_init, stride::util::RnInfo::m_state, stride::util::RnInfo::m_stream_count, and stride::util::Split().
Referenced by stride::util::Rn< pcg64 >::GetDiscreteGenerator(), and stride::util::Rn< pcg64 >::Rn().


|
inline |
|
inline |
|
private |
Actual first-time seeding. Procedure varies according to engine type, see specialisations.
Definition at line 104 of file Rn.cpp.
Referenced by stride::util::Rn< pcg64 >::Shuffle().

|
private |
|
private |
|
private |
|
private |
Number of threads/streams set up with the engine.
Definition at line 120 of file Rn.h.
Referenced by stride::util::Rn< pcg64 >::IsEmpty(), and stride::util::Rn< E >::operator==().