strusBase  0.17
Public Member Functions | List of all members
strus::PseudoRandom Class Reference

Pseudo random generator. Fast generator for series of pseudo random numbers where the security is not an issue and the quality of the distribution has not to be guaranteed. More...

#include <pseudoRandom.hpp>

Public Member Functions

 PseudoRandom ()
 Constructor with seed derived from current date (granularity day) More...
 
 PseudoRandom (int seed_)
 Constructor with seed passed as argument. More...
 
int get (int start_, int end_)
 Get the next "random" number between two numbers. More...
 
int select (unsigned int psize, int firstValue,...)
 Get the next "random" value of a specified set. More...
 

Detailed Description

Pseudo random generator. Fast generator for series of pseudo random numbers where the security is not an issue and the quality of the distribution has not to be guaranteed.

Constructor & Destructor Documentation

strus::PseudoRandom::PseudoRandom ( )

Constructor with seed derived from current date (granularity day)

strus::PseudoRandom::PseudoRandom ( int  seed_)
explicit

Constructor with seed passed as argument.

Member Function Documentation

int strus::PseudoRandom::get ( int  start_,
int  end_ 
)

Get the next "random" number between two numbers.

Parameters
[in]start_minumum result
[in]end_upper border of range (first number not included)
Returns
"randomly" selected integer in [start_,end_[
int strus::PseudoRandom::select ( unsigned int  psize,
int  firstValue,
  ... 
)

Get the next "random" value of a specified set.

Parameters
[in]psizesize of candidate set
[in]firstValuefirst result candidate (for ensuring that there is at least one)
[in]...list of other candidates to select one from (int's)
Returns
"randomly" selected candidate

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