Sample SNPs
Fast ordered sampling of rows from large text or binary files. Special cases for DNA variant files (.bed, VCF, HapMap, etc).
|
Go to the documentation of this file.
77 virtual volatile uint64_t
ranInt() = 0;
120 volatile uint64_t
ranInt();
130 static const unsigned short _n;
132 static const unsigned short _m;
134 static const uint64_t
_um;
136 static const uint64_t
_lm;
138 static const uint64_t
_b;
140 static const uint64_t
_c;
142 static const uint64_t
_d;
144 static const unsigned int _l;
146 static const unsigned int _s;
148 static const unsigned int _t;
150 static const unsigned int _u;
194 volatile uint64_t
ranInt();
248 volatile double runif() {
return 5.42101086242752217E-20*
static_cast<double>(_rng->
ranInt()); };
264 volatile uint64_t
vitterA(
const double &n,
const double &N);
275 volatile uint64_t
vitter(
const double &n,
const double &N);
Hardware random number generating class.
Definition: random.hpp:85
static const uint64_t _d
Tempering bitmask.
Definition: random.hpp:142
Pseudo-random number generator.
Definition: random.hpp:127
GenerateHR(GenerateHR &&old)
Move constructor.
Definition: random.hpp:102
virtual ~Generate()
Protected destructor.
Definition: random.hpp:72
volatile double runif()
Generate a uniform deviate.
Definition: random.hpp:248
volatile uint64_t vitter(const double &n, const double &N)
Sample from Vitter's distribution, method D.
Definition: random.cpp:218
static const unsigned int _l
Tempering shift.
Definition: random.hpp:144
volatile uint64_t ranInt()
Generate random integer.
Definition: random.hpp:242
GenerateMT()
Default constructor.
Definition: random.cpp:85
static const unsigned short _n
Degree of recurrence.
Definition: random.hpp:130
RanDraw(const RanDraw &old)=default
Copy constructor.
GenerateMT & operator=(const GenerateMT &old)=default
Copy assignment operator.
GenerateMT(const GenerateMT &old)=default
Copy constructor.
~GenerateMT()
Protected destructor.
Definition: random.hpp:167
static const uint64_t _c
Tempering bitmask.
Definition: random.hpp:140
volatile uint64_t vitterA(const double &n, const double &N)
Sample from Vitter's distribution, method A.
Definition: random.cpp:184
volatile uint64_t ranInt()
Generate a pseudo-random 64-bit unsigned integer.
Definition: random.cpp:104
~GenerateHR()
Destructor.
Definition: random.hpp:92
Generate & operator=(const Generate &old)=default
Protected copy assignment operator.
size_t _mti
State of the array index.
Definition: random.hpp:156
static const uint64_t _um
Most significant 33 bits.
Definition: random.hpp:134
Random number generating class.
Definition: random.hpp:202
virtual volatile uint64_t ranInt()=0
Generate a (pseudo-)random 64-bit unsigned integer.
RanDraw(RanDraw &&old)=default
Move constructor.
GenerateHR(const GenerateHR &old)
Copy constructor.
Definition: random.hpp:97
static const uint64_t _lm
Least significant 31 bits.
Definition: random.hpp:136
volatile uint64_t ranInt()
Generate a random 64-bit unsigned integer.
Definition: random.cpp:42
static const uint64_t _b
Tempering bitmask.
Definition: random.hpp:138
RanDraw()
Default constructor.
Definition: random.cpp:134
GenerateHR & operator=(const GenerateHR &old)=default
Copy assignment operator.
RanDraw & operator=(const RanDraw &old)=default
Copy assignment.
GenerateMT(GenerateMT &&old)=default
Move constructor.
~RanDraw()
Destructor.
Definition: random.hpp:215
Generate()
Protected default constructor.
Definition: random.hpp:48
Abstract base random number class.
Definition: random.hpp:45
uint64_t _x
Current state.
Definition: random.hpp:158
volatile double runifnz()
Generate a non-zero uniform deviate.
Definition: random.cpp:175
static const unsigned int _u
Tempering shift.
Definition: random.hpp:150
static const unsigned int _t
Tempering shift.
Definition: random.hpp:148
static const uint64_t _alt[2]
Array of alternative values for the twist.
Definition: random.hpp:152
GenerateHR()
Default constructor.
Definition: random.hpp:90
static const unsigned int _s
Tempering shift.
Definition: random.hpp:146
static const unsigned short _m
Middle word.
Definition: random.hpp:132
Generate(const Generate &old)
Protected copy constructor.
Definition: random.hpp:53
Generate(Generate &&old)
Protected move constructor.
Definition: random.hpp:58
uint64_t _mt[312]
Generator state array.
Definition: random.hpp:154