onemkl::rng::gamma

Generates gamma distributed random values.

Syntax

template<typename T = float, method Method =      marsaglia>
  class gamma {
  public:
    gamma(): gamma((T)1.0, (T)0.0, (T)1.0){}
    gamma(T alpha, T a, T beta)
    gamma(const gamma<T, Method>& other)
    T alpha() const
    T a() const
    T beta() const
    gamma<T, Method>& operator=(const gamma<T,      Method>& other)
  }

Include Files

  • mkl_sycl.hpp

Description

The onemkl::rng::gamma class object is used in the onemkl::rng::generate function to provide random numbers with gamma distribution that has shape parameter α, displacement a, and scale parameter β, where α, β, and a∈R ; α > 0, β > 0.

The probability density function is given by:

where Γ(α) is the complete gamma function.

The cumulative distribution function is as follows:

Input Parameters

Name

Type

Description

method

onemkl::rng::method

Generation method. The specific values are as follows: onemkl::rng::marsaglia onemkl::rng::marsaglia | onemkl::rng::accurate See brief descriptions of the methods in Distributions Template Parameter onemkl::rng::method Values.

alpha

T (float, double)

Shape α

a

T (float, double)

Displacement a.

beta

T (float, double)

Scalefactor β.