mkl::rng::device::uniform (Discrete)

Generates random numbers uniformly distributed over the interval [a, b).

Syntax

template<typename Method>

class uniform<std::int32_t, Method> {

public:

using method_type = Method;

using result_type = std::int32_t;

uniform(): uniform(0, std::numeric_limits<std::int32_t>::max()){}; explicit uniform(std::int32_t a, std::int32_t b);

std::int32_t a() const;

std::int32_t b() const;

};

Include Files

Description

The mkl::rng::device::uniform class object is used in mkl::rng::device::generate functions to provide random numbers uniformly distributed over the interval [a, b), where a, b are the left and right bounds of the interval respectively, and a, bZ; a < b.

The probability distribution is given by:


Equation

The cumulative distribution function is as follows:


Equation

Template Parameters

typename Method = mkl::rng::device::uniform_method::by_default

Generation method. The specific values are as follows:

mkl::rng::uniform_method::standard

Input Parameters

Name

Type

Description

c

std::int32_t

Left bound a

d

std::int32_t

Right bound b