oneapi::mkl::rng::uniform (Continuous)¶
Generates random numbers with uniform distribution.
Syntax
template<typename Type = float, typename Method = uniform_method::by_default>
class uniform {
public:
using method_type = Method; using result_type = Type;
uniform(): uniform((Type)0.0, (Type)1.0){}
explicit uniform(Type a, Type b);
Type a() const;
Type b() const;
};
Devices supported: Host, CPU, and GPU.
Include Files
oneapi/mkl/rng.hpp
Description
The class object is used in oneapi::mkl::rng::generate function 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∈R
; a
< b
.
The probability density function is given by:
The cumulative distribution function is as follows:
Template Parameters
|
Type of the produced values. The specific values are as follows: |
---|---|
|
Generation method. The specific values are as follows: |
Input Parameters
Name |
Type |
Description |
---|---|---|
a |
|
Left bound |
b |
|
Right bound |