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:


image0

The cumulative distribution function is as follows:


image1

Input Parameters

Name

Type

Description

method

onemkl::rng::method

Generation method. The specific values are as follows: onemkl::rng::btpe See brief descriptions of the methods in Distributions Template Parameter onemkl::rng::method Values.

ntrials

std::int32_t

Number of independent trials.

p

double

Success probability p of a single trial.