oneapi::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

  • oneapi/mkl/rng/device.hpp

Description

The oneapi::mkl::rng::device::uniform class object is used in oneapi::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, b∈Z; a < b.

The probability distribution is given by:


image0

The cumulative distribution function is as follows:


image1

Template Parameters

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

Generation method. The specific values are as follows: oneapi::mkl::rng::uniform_method::standard

Input Parameters

Name

Type

Description

c

std::int32_t

Left bound a

d

std::int32_t

Right bound b