#include <seed.hpp>
◆ seed() [1/2]
The random number generator should act as a singleton, no need for default constructors.
◆ seed() [2/2]
pass::seed::seed |
( |
const seed & |
| ) |
|
|
delete |
◆ get_generator()
std::mt19937_64 & pass::seed::get_generator |
( |
| ) |
|
|
static |
The std::mersenne_twister_engine requires an l-value (a reference in this case) instead of an r-value. Otherwise, calls like std::uniform_real_distribution<double>(0, 1)(seed::get_generator()) won't compile.
◆ get_seed()
arma::arma_rng::seed_type pass::seed::get_seed |
( |
| ) |
|
|
static |
Gets the seed if you want to reproduce the experiment
◆ operator=()
seed& pass::seed::operator= |
( |
const seed & |
| ) |
|
|
delete |
◆ set_random_seed()
void pass::seed::set_random_seed |
( |
| ) |
|
|
static |
Initialise Armadillo's generator with any random seed. This seed will be overwritten later on, no need to store it.
For programs using MPI, each node needs to seeded differently in order to avoid a degeneration of the random number generator, due to synchronisation. Basically, we generated as much random numbers as there are nodes and seed the i-th node by the i-th generated random number.
Without MPI, using the first random number generated by Armadillo's generator as seed is sufficient.
◆ set_seed()
void pass::seed::set_seed |
( |
const arma::arma_rng::seed_type |
seed | ) |
|
|
static |
Seeding C++'s and Armadillo's generator.
◆ generator_
std::mt19937_64 pass::seed::generator_ |
|
staticprotected |
◆ seed_
arma::arma_rng::seed_type pass::seed::seed_ |
|
staticprotected |
The documentation for this class was generated from the following files:
- /Users/romeo/Desktop/PASS/include/pass_bits/helper/seed.hpp
- /Users/romeo/Desktop/PASS/src/helper/seed.cpp