RaftLib  0.3a
C++ Stream Processing Template Library
Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
raft::randombase Class Reference
Collaboration diagram for raft::randombase:
[legend]

Public Member Functions

 randombase (const raft::rndgenerator gen, const std::uint64_t seed)
 
 randombase (const raft::rndgenerator gen)
 

Static Protected Member Functions

static std::uint64_t sample_system_rng ()
 

Protected Attributes

gsl_rng * rng = nullptr
 

Constructor & Destructor Documentation

randombase::randombase ( const raft::rndgenerator  gen,
const std::uint64_t  seed 
)

randombase - initialize random number generator, provide a seed. useful for debugging, however for a more random source it is advisable to use the non-seeded version which uses system entropy. The first parameter is the random number generator. For the moment these are entirely sourced from GNU GSL so feel free to consult their docs here (http://goo.gl/tfElhG).

Parameters
gen- raft::rndgenerator
seed- const std::uint64_t
randombase::randombase ( const raft::rndgenerator  gen)

randombase - initialize random number generator, uses system entropy for a more random seed to the random number generator. The first parameter is the random number generator. For the moment these are entirely sourced from GNU GSL so feel free to consult their docs here (http://goo.gl/tfElhG).

Here is the call graph for this function:

Member Function Documentation

std::uint64_t randombase::sample_system_rng ( )
staticprotected

sample_system_rng - returns system provided uint64_t from /dev/urandom. Normally I'd say use /dev/random however then we have to handle blocking for lack of entropy and this seems a bit simpler at the moment.

Returns
std::uint64_t

TODO, throw appropriate raft exception

Here is the caller graph for this function:

Member Data Documentation

gsl_rng* raft::randombase::rng = nullptr
protected

vars


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