Visible to Intel only — GUID: GUID-E49B62AE-33C4-4D2A-9CFA-C76AF66F2A8D
Visible to Intel only — GUID: GUID-E49B62AE-33C4-4D2A-9CFA-C76AF66F2A8D
bernoulli
Generates Bernoulli distributed random values.
Description
The bernoulli class object is used in the generate function to provide Bernoulli distributed random numbers with probability p of a single trial success, where .
The probability distribution is given by:
The cumulative distribution function is as follows:
API
Syntax
namespace oneapi::mkl::rng::device {
template<typename IntType, typename Method>
class bernoulli {
public:
using method_type = Method;
using result_type = IntType;
bernoulli(): bernoulli(0.5f){}
explicit bernoulli(float p);
explicit bernoulli(const param_type& pt);
float p() const;
param_type param() const;
void param(const param_type& pt);
};
}
Include Files
oneapi/mkl/rng/device.hpp
Template Parameters
typename Type |
Type of the produced values. The specific values are as follows:
|
typename Method |
Generation method. The specific values are as follows:
See brief descriptions of the methods in Distributions Template Parameter Method. |
Input Parameters
Name |
Type |
Description |
---|---|---|
p |
float |
Success probability p of a trial. |