onemkl::rng::binomial¶
Generates binomially distributed random numbers.
Syntax
template<typename T = std::int32_t, method Method = btpe>
class binomial {
public:
binomial(): binomial(5, 0.5){}
binomial(std::int32_t ntrial, double p)
binomial(const binomial<T, Method>& other)
std::int32_t ntrial() const
double p() const
binomial<T, Method>& operator=(const binomial<T, Method>& other)
}
Include Files
mkl_sycl.hpp
Description
The onemkl::rng::binomial class object is used in the
onemkl::rng::generate function to provide binomially distributed
random numbers with number of independent Bernoulli trials m
,
and with probability p
of a single trial success, where
p∈R; 0 ≤p≤ 1, m∈N
.
A binomially distributed variate represents the number of
successes in m
independent Bernoulli trials with probability
of a single trial success p
.
The probability distribution is given by:

The cumulative distribution function is as follows:

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