exponential distribution

group turbo_random_exponential

Functions

template<typename RealType, typename URBG>
RealType exponential(URBG &&urbg, RealType lambda = 1)

turbo::exponential<T>(bitgen, lambda = 1) turbo::exponential produces a floating point number representing the distance (time) between two consecutive events in a point process of events occurring continuously and independently at a constant average rate.

T must be a floating point type, but may be inferred from the type of lambda. See https://en.wikipedia.org/wiki/Exponential_distribution.

Example:

cpp
      turbo::BitGen bitgen;
      ...
      double call_length = turbo::exponential(bitgen, 7.0);

Template Parameters:
  • RealType

  • URBG

Parameters:
  • urbg

  • lambda

Returns:

RealType

template<typename RealType>
RealType exponential(RealType lambda = 1)

similar to turbo::exponential<T>(bitgen, lambda = 1) but use the default bitgen

Template Parameters:

RealType

Parameters:

lambda

Returns:

RealType

template<typename RealType>
RealType fast_exponential(RealType lambda = 1)

similar to turbo::exponential<T>(bitgen, lambda = 1) but use the fast bitgen

Template Parameters:

RealType

Parameters:

lambda

Returns:

RealType

template<typename RealType = double>
class exponential_distribution
#include <exponential_distribution.h>

turbo::exponential_distribution<T> generates a number conforming to an exponential distribution and is equivalent to the standard [rand.dist.pois.exp] distribution.

See https://en.wikipedia.org/wiki/Exponential_distribution. Example:

cpp
      turbo::BitGen bitgen;
      ...
      double call_length = turbo::exponential(bitgen, 7.0);

Template Parameters:

RealType

class param_type