Rosetta
|
#include <mt19937.hh>
Public Member Functions | |
mt19937_RG () | |
~mt19937_RG () override=default | |
void | setSeed (int const iseed) override |
Set seed and state. More... | |
void | setSeed (std::string const &) override |
Set seed and state. More... | |
int | getSeed () override |
double | getRandom () override |
void | saveState (std::ostream &out) override |
Serializes generator state to stream losslessly. More... | |
void | restoreState (std::istream &in) override |
Deserializes generator state from stream losslessly. More... | |
![]() | |
uniform_RG () | |
~uniform_RG () override=default | |
![]() | |
VirtualBase ()=default | |
Default constructor. More... | |
virtual | ~VirtualBase ()=default |
The virtual destructor is one of the main reasons for the VirtualBase class. More... | |
VirtualBase (VirtualBase const &)=default | |
VirtualBase (VirtualBase &&)=default | |
VirtualBase & | operator= (VirtualBase const &)=default |
VirtualBase & | operator= (VirtualBase &&)=default |
Protected Member Functions | |
void | initial_mask (void) |
void | period_certification () |
void | init_by_array (uint32_t init_key[], int key_length) |
void | gen_rand_all (void) |
Private Attributes | |
int | iseed_ |
w128_t | sformat [DSFMT_N+1] |
double * | psformat64 |
int | sformat_idx |
int | is_sformat_initialized |
|
inline |
References W128_T::d, psformat64, and sformat.
|
overridedefault |
|
inlineprotected |
This function fills the internal state array with double precision floating point pseudorandom numbers of the IEEE 754 format.
References numeric::random::do_recursion(), DSFMT_N, DSFMT_POS1, create_a3b_hbs::i, and sformat.
Referenced by getRandom().
|
inlineoverridevirtual |
Implements numeric::random::uniform_RG.
References DSFMT_N, gen_rand_all(), is_sformat_initialized, psformat64, create_a3b_hbs::r, and sformat_idx.
|
inlineoverridevirtual |
Implements numeric::random::uniform_RG.
References iseed_.
|
inlineprotected |
This function initializes the internal state array, with an array of 32-bit integers used as the seeds
init_key | the array of 32-bit integers, used as a seed. |
key_length | the length of init_key. |
References count, DSFMT_N, DSFMT_N64, create_a3b_hbs::i, numeric::random::ini_func1(), numeric::random::ini_func2(), initial_mask(), is_sformat_initialized, create_a3b_hbs::j, period_certification(), create_a3b_hbs::r, sformat, sformat_idx, numeric::random::sformat_idxof(), subloop_histogram::size, and W128_T::u32.
|
inlineprotected |
This function initializes the internal state array to fit the IEEE 754 format.
References DSFMT_HIGH_CONST, DSFMT_LOW_MASK, DSFMT_N, create_a3b_hbs::i, sformat, and W128_T::u.
Referenced by init_by_array(), and setSeed().
|
inlineprotected |
This function certificate the period of 2^{DSFMT_MEXP}-1.
References DSFMT_HIGH_CONST, DSFMT_MSK1, DSFMT_MSK2, DSFMT_N, DSFMT_PCV1, DSFMT_PCV2, DSFMT_SL2, DSFMT_SR1, DSFMT_SR2, basic::options::OptionKeys::optE::fix, create_a3b_hbs::i, test_terpenes::inner, create_a3b_hbs::j, sformat, and W128_T::u.
Referenced by init_by_array(), and setSeed().
|
inlineoverridevirtual |
Deserializes generator state from stream losslessly.
Implements numeric::random::uniform_RG.
References create_a3b_hbs::i, is_sformat_initialized, sformat, and sformat_idx.
|
inlineoverridevirtual |
Serializes generator state to stream losslessly.
Implements numeric::random::uniform_RG.
References create_a3b_hbs::i, is_sformat_initialized, sformat, and sformat_idx.
|
inlineoverridevirtual |
Set seed and state.
Implements numeric::random::uniform_RG.
References DSFMT_N, DSFMT_N64, create_a3b_hbs::i, initial_mask(), is_sformat_initialized, iseed_, period_certification(), sformat, sformat_idx, numeric::random::sformat_idxof(), and W128_T::u32.
|
inlineoverridevirtual |
Set seed and state.
Implements numeric::random::uniform_RG.
|
private |
a flag: it is 0 if and only if the internal state is not yet initialized.
Referenced by getRandom(), init_by_array(), restoreState(), saveState(), and setSeed().
|
private |
|
private |
the double pointer to the 128-bit internal state array
Referenced by getRandom(), and mt19937_RG().
the 128-bit internal state array
Referenced by gen_rand_all(), init_by_array(), initial_mask(), mt19937_RG(), period_certification(), restoreState(), saveState(), and setSeed().
|
private |
index counter to the internal state array as double
Referenced by getRandom(), init_by_array(), restoreState(), saveState(), and setSeed().