Visible to Intel only — GUID: GUID-2C401FE6-2F93-4B2B-BDE3-B98299747BC0
Visible to Intel only — GUID: GUID-2C401FE6-2F93-4B2B-BDE3-B98299747BC0
hypergeometric
Generates hypergeometrically distributed random values.
Description
The hypergeometric class object is used in the generate function to provide hypergeometrically distributed random values with lot size l, size of sampling s, and number of marked elements in the lot m, where .
Consider a lot of l elements comprising m “marked” and l-m “unmarked” elements. A trial sampling without replacement of exactly s elements from this lot helps to define the hypergeometric distribution, which is the probability that the group of s elements contains exactly k marked elements.
The probability distribution is given by:
, k∈ {max(0, s + m - l), …, min(s, m)}
The cumulative distribution function is as follows:
Product and Performance Information |
---|
Performance varies by use, configuration and other factors. Learn more at https://www.intel.com/PerformanceIndex. Notice revision #20201201 |
API
Syntax
namespace oneapi::mkl::rng {
template<typename IntType = std::int32_t,
typename Method = hypergeometric_method::by_default>
class hypergeometric {
public:
using method_type = Method;
using result_type = IntType;
hypergeometric(): hypergeometric(1, 1, 1){}
explicit hypergeometric(std::int32_t l, std::int32_T s, std::int32_T m);
explicit hypergeometric(const param_type& pt);
std::int32_t s() const;
std::int32_t m() const;
std::int32_t l() const;
param_type param() const;
void param(const param_type& pt);
};
}
Devices supported: CPU and GPU
Include Files
oneapi/mkl/rng.hpp
Template Parameters
typename IntType = std::int32_t |
Type of the produced values. The specific values are as follows: std::int32_t std::uint32_t |
typename Method = oneapi::mkl::rng:: hypergeometric_method:: by_default |
Generation method. The specific values are as follows: oneapi::mkl::rng::hypergeometric_method::h2pe See brief descriptions of the methods in Distributions Template Parameter Method. |
Input Parameters
Name |
Type |
Description |
---|---|---|
l |
std::int32_t |
Lot size of l. |
s |
std::int32_t |
Size of sampling without replacement. |
m |
std::int32_t |
Number of marked elements m. |