|
Sample SNPs
Fast ordered sampling of rows from large text or binary files. Special cases for DNA variant files (.bed, VCF, HapMap, etc).
|
Pseudo-random number generator. More...
#include <random.hpp>
Public Member Functions | |
| GenerateMT () | |
| Default constructor. More... | |
| ~GenerateMT () | |
| Protected destructor. | |
| GenerateMT (const GenerateMT &old)=default | |
| Copy constructor. More... | |
| GenerateMT (GenerateMT &&old)=default | |
| Move constructor. More... | |
| GenerateMT & | operator= (const GenerateMT &old)=default |
| Copy assignment operator. More... | |
| GenerateMT & | operator= (GenerateMT &&old)=default |
| Move assignment. More... | |
| volatile uint64_t | ranInt () |
| Generate a pseudo-random 64-bit unsigned integer. More... | |
Public Member Functions inherited from sampFiles::Generate | |
| virtual | ~Generate () |
| Protected destructor. | |
Protected Attributes | |
| uint64_t | _mt [312] |
| Generator state array. | |
| size_t | _mti |
| State of the array index. | |
| uint64_t | _x |
| Current state. | |
Static Protected Attributes | |
| static const unsigned short | _n = 312 |
| Degree of recurrence. | |
| static const unsigned short | _m = 156 |
| Middle word. | |
| static const uint64_t | _um = static_cast<uint64_t>(0x7FFFFFFF) |
| Most significant 33 bits. | |
| static const uint64_t | _lm = static_cast<uint64_t>(0xFFFFFFFF80000000) |
| Least significant 31 bits. | |
| static const uint64_t | _b = static_cast<uint64_t>(0x71D67FFFEDA60000) |
| Tempering bitmask. | |
| static const uint64_t | _c = static_cast<uint64_t>(0xFFF7EEE000000000) |
| Tempering bitmask. | |
| static const uint64_t | _d = static_cast<uint64_t>(0x5555555555555555) |
| Tempering bitmask. | |
| static const unsigned int | _l = 43 |
| Tempering shift. | |
| static const unsigned int | _s = 17 |
| Tempering shift. | |
| static const unsigned int | _t = 37 |
| Tempering shift. | |
| static const unsigned int | _u = 29 |
| Tempering shift. | |
| static const uint64_t | _alt [2] = {static_cast<uint64_t>(0), static_cast<uint64_t>(0xB5026F5AA96619E9)} |
| Array of alternative values for the twist. | |
Additional Inherited Members | |
Protected Member Functions inherited from sampFiles::Generate | |
| Generate () | |
| Protected default constructor. | |
| Generate (const Generate &old) | |
| Protected copy constructor. More... | |
| Generate (Generate &&old) | |
| Protected move constructor. More... | |
| Generate & | operator= (const Generate &old)=default |
| Protected copy assignment operator. More... | |
| Generate & | operator= (Generate &&old)=default |
| Protected move assignment. More... | |
Pseudo-random number generator.
An implementaiton of the 64-bit MT19937 ("Mersenne Twister") [1] pseudo-random number generator (PRNG). The constructor automatically seeds the PRNG. The implementation was guided by the reference code posted by the authors.
| GenerateMT::GenerateMT | ( | ) |
Default constructor.
Seeds the PRNG with a call to the RDTSC instruction.
|
default |
Copy constructor.
| [in] | old | object to copy |
|
default |
Move constructor.
| [in] | old | object to move |
|
default |
Copy assignment operator.
| [in] | old | object to copy |
|
default |
Move assignment.
| [in] | old | object to move |
|
virtual |
Generate a pseudo-random 64-bit unsigned integer.
Implements sampFiles::Generate.