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

Random number distributions. More...

Classes

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

◆ copy_k_of_n()

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

◆ random_shuffle()

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 Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14