vSMC
v3.0.0
Scalable Monte Carlo
|
Seed generator. More...
#include <vsmc/rng/seed.hpp>
Public Types | |
using | result_type = ResultType |
Public Member Functions | |
SeedGenerator (const SeedGenerator< ID, ResultType > &)=delete | |
result_type | divisor () const |
The divisor of the output seed. More... | |
result_type | get () |
Get a seed. More... | |
result_type | max () const |
The maximum of the seed. More... | |
void | modulo (result_type divisor, result_type remainder) |
Set the divisor and the remainder. More... | |
template<typename RNGType > | |
void | operator() (RNGType &rng) |
Seed a single RNG. More... | |
template<typename OutputIter > | |
OutputIter | operator() (std::size_t n, OutputIter first) |
Seed a sequence of RNGs. More... | |
SeedGenerator< ID, ResultType > & | operator= (const SeedGenerator< ID, ResultType > &)=delete |
result_type | remainder () const |
The remainder of the output seed. More... | |
void | set (result_type s) |
Set the seed to s % max() * divisor() + remainder() More... | |
Static Public Member Functions | |
static SeedGenerator< ID, ResultType > & | instance () |
Friends | |
template<typename CharT , typename Traits > | |
std::basic_ostream< CharT, Traits > & | operator<< (std::basic_ostream< CharT, Traits > &os, const SeedGenerator< ID, ResultType > &sg) |
template<typename CharT , typename Traits > | |
std::basic_istream< CharT, Traits > & | operator>> (std::basic_istream< CharT, Traits > &is, SeedGenerator< ID, ResultType > &sg) |
Seed generator.
The sequence of seeds are belongs to the equivalent class \(s \mod D \equiv R\) where \(D > 0\), \(R \ge 0\). The defaults are \(1\) and \(0\) respectively. Each time get()
is called, a new seed is returned.
The method operator()(RNGType &rng)
is equivalent to rng.seed(static_cast<typename RNGType::result_type>(get()))
.
using vsmc::SeedGenerator< ID, ResultType >::result_type = ResultType |
|
delete |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
delete |
|
inline |
|
inline |
Set the seed to s % max() * divisor() + remainder()
|
friend |
|
friend |