![]() |
Rosetta Utilities
2014.35
|
#include <mt19937.hh>
Public Member Functions | |
mt19937_RG () | |
virtual | ~mt19937_RG () |
void | setSeed (int const iseed) |
Set seed and state. More... | |
void | setSeed (std::string const &) |
Set seed and state. More... | |
int | getSeed () |
double | getRandom () |
virtual void | saveState (std::ostream &out) |
Serializes generator state to stream losslessly. More... | |
virtual void | restoreState (std::istream &in) |
Deserializes generator state from stream losslessly. More... | |
![]() | |
uniform_RG () | |
virtual | ~uniform_RG () |
![]() | |
void | ctor () |
virtual | ~ReferenceCount () |
Destructor. More... | |
Size | ref_count () const |
Reference count. More... | |
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) |
![]() | |
ReferenceCount () | |
Default constructor. More... | |
ReferenceCount (ReferenceCount const &) | |
Copy constructor. More... | |
ReferenceCount & | operator= (ReferenceCount const &) |
Copy assignment. More... | |
Private Attributes | |
int | iseed_ |
w128_t | sformat [DSFMT_N+1] |
double * | psformat64 |
int | sformat_idx |
int | is_sformat_initialized |
Additional Inherited Members | |
![]() | |
typedef platform::Size | Size |
typedef platform::Size | size_type |
|
inline |
References W128_T::d, is_sformat_initialized, psformat64, and sformat.
|
inlinevirtual |
|
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, and sformat.
Referenced by getRandom().
|
inlinevirtual |
Implements numeric::random::uniform_RG.
References DSFMT_N, gen_rand_all(), is_sformat_initialized, psformat64, and sformat_idx.
|
inlinevirtual |
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 DSFMT_N, DSFMT_N64, numeric::random::ini_func1(), numeric::random::ini_func2(), initial_mask(), is_sformat_initialized, period_certification(), sformat, sformat_idx, numeric::random::sformat_idxof(), 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, 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, sformat, and W128_T::u.
Referenced by init_by_array(), and setSeed().
|
inlinevirtual |
Deserializes generator state from stream losslessly.
Implements numeric::random::uniform_RG.
References DSFMT_N, is_sformat_initialized, sformat, sformat_idx, and W128_T::u.
|
inlinevirtual |
Serializes generator state to stream losslessly.
Implements numeric::random::uniform_RG.
References DSFMT_N, is_sformat_initialized, sformat, sformat_idx, and W128_T::u.
|
inlinevirtual |
Set seed and state.
Implements numeric::random::uniform_RG.
References DSFMT_N, DSFMT_N64, initial_mask(), is_sformat_initialized, iseed_, period_certification(), sformat, sformat_idx, numeric::random::sformat_idxof(), and W128_T::u32.
|
inlinevirtual |
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(), mt19937_RG(), 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().