yat  0.14.5pre
Classes | Functions
theplu::yat::random Namespace Reference

Random number distributions. More...

Classes

class  RNG
 Random Number Generator. More...
 
class  RNG_state
 Class holding state of a random generator. More...
 
class  Discrete
 Discrete random number distributions. More...
 
class  Binomial
 Binomial distribution. More...
 
class  DiscreteGeneral
 General. More...
 
class  DiscreteUniform
 Discrete uniform distribution. More...
 
class  Geometric
 Geomtric Distribution. More...
 
class  HyperGeometric
 
class  NegativeHyperGeometric
 
class  Poisson
 Poisson Distribution. More...
 
class  Continuous
 Continuous random number distributions. More...
 
class  ContinuousUniform
 Uniform distribution. More...
 
class  ContinuousGeneral
 Generates numbers from a histogram in a continuous manner. More...
 
class  Exponential
 Generator of random numbers from an exponential distribution. More...
 
class  Gaussian
 Gaussian distribution. More...
 

Functions

template<typename InputIterator , typename Size1 , typename Size2 , typename OutputIterator >
OutputIterator copy_k_of_n (InputIterator it, Size1 k, Size2 n, OutputIterator out)
 
template<typename RandomAccessIterator >
void random_shuffle (RandomAccessIterator first, RandomAccessIterator last)
 Convenience function to shuffle a range with singleton RNG. More...
 

Detailed Description

Random number distributions.

The yat random number related functionality is placed within the random namespace.

Function Documentation

template<typename InputIterator , typename Size1 , typename Size2 , typename OutputIterator >
OutputIterator theplu::yat::random::copy_k_of_n ( InputIterator  it,
Size1  k,
Size2  n,
OutputIterator  out 
)

Copy k random element out of range [it, it+n) into output range [out, out+k).

Each element in the input range is copied with equal probability: k/n.

Type Requirements:

Returns
iterator one-passed the last element copied
Since
New in yat 0.14
template<typename RandomAccessIterator >
void theplu::yat::random::random_shuffle ( RandomAccessIterator  first,
RandomAccessIterator  last 
)

Convenience function to shuffle a range with singleton RNG.

Wrapper around std::random_shuffle using DiscreteUniform as random generator and thereby using the underlying RNG class, which is singleton.

Type Requirements:


Generated on Tue Sep 26 2017 02:33:30 for yat by  doxygen 1.8.5