Sample SNPs
Fast ordered sampling of rows from large text or binary files. Special cases for DNA variant files (.bed, VCF, HapMap, etc).
Public Member Functions | List of all members
sampFiles::GenerateHR Class Reference

Hardware random number generating class. More...

#include <random.hpp>

Inheritance diagram for sampFiles::GenerateHR:
[legend]
Collaboration diagram for sampFiles::GenerateHR:
[legend]

Public Member Functions

 GenerateHR ()
 Default constructor.
 
 ~GenerateHR ()
 Destructor.
 
 GenerateHR (const GenerateHR &old)
 Copy constructor. More...
 
 GenerateHR (GenerateHR &&old)
 Move constructor. More...
 
GenerateHRoperator= (const GenerateHR &old)=default
 Copy assignment operator. More...
 
GenerateHRoperator= (GenerateHR &&old)=default
 Move assignment. More...
 
volatile uint64_t ranInt ()
 Generate a random 64-bit unsigned integer. More...
 
- Public Member Functions inherited from sampFiles::Generate
virtual ~Generate ()
 Protected destructor.
 

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...
 
Generateoperator= (const Generate &old)=default
 Protected copy assignment operator. More...
 
Generateoperator= (Generate &&old)=default
 Protected move assignment. More...
 

Detailed Description

Hardware random number generating class.

Generates random deviates from a number of distributions, using hardware random numbers (RDRAND processor instruction). Health of the RDRAND generator is tested every time a new number is required. Throws a string object "RDRAND_failed" if the test fails. The implementation of random 64-bit integer generation follows Intel's suggestions.

Constructor & Destructor Documentation

◆ GenerateHR() [1/2]

sampFiles::GenerateHR::GenerateHR ( const GenerateHR old)
inline

Copy constructor.

Parameters
[in]oldobject to copy

◆ GenerateHR() [2/2]

sampFiles::GenerateHR::GenerateHR ( GenerateHR &&  old)
inline

Move constructor.

Parameters
[in]oldobject to move

Member Function Documentation

◆ operator=() [1/2]

GenerateHR& sampFiles::GenerateHR::operator= ( const GenerateHR old)
default

Copy assignment operator.

Parameters
[in]oldobject to copy

◆ operator=() [2/2]

GenerateHR& sampFiles::GenerateHR::operator= ( GenerateHR &&  old)
default

Move assignment.

Parameters
[in]oldobject to move

◆ ranInt()

volatile uint64_t GenerateHR::ranInt ( )
virtual

Generate a random 64-bit unsigned integer.

Monitors the health of the CPU random number generator and throws a string object "RDRAND_failed" if a failure is detected after ten tries.

Returns
digital random 64-bit unsigned integer

Implements sampFiles::Generate.


The documentation for this class was generated from the following files: