onemkl::rng::geometric¶
Generates geometrically distributed random values.
Syntax
template<typename T = std::int32_t, method Method = inverse_function>
class geometric {
public:
geometric(): geometric(0.5){}
geometric(double p)
geometric(const geometric<T, Method>& other)
double p() const
geometric<T, Method>& operator=(const geometric<T, Method>& other)
}
Include Files
mkl_sycl.hpp
Description
The onemkl::rng::geometric class object is used in the
onemkl::rng::generate function to provide geometrically distributed
random numbers with probability p
of a single trial success,
where p∈R; 0 < p < 1.
A geometrically distributed variate represents the number of
independent Bernoulli trials preceding the first success. The
probability of a single Bernoulli trial success is p
.
The probability distribution is given by:
P
(X
= k
) = p
·(1 - p
)k, k
∈
{0,1,2, … }.
The cumulative distribution function is as follows:

Input Parameters
Name |
Type |
Description |
---|---|---|
method |
|
Generation method. The specific values are as follows: |
p |
|
Success probability |
Parent topic: Distributions