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 \(l, m, s \in N \cup \left \{ 0 \right \}; l \geq max(s, m)\).
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#
|
Type of the produced values. The specific values are as follows:
|
|
Generation method. The specific values are as follows:
See brief descriptions of the methods in Distributions Template Parameter Method. |
Input Parameters#
Name |
Type |
Description |
|---|---|---|
l |
|
Lot size of |
s |
|
Size of sampling without replacement. |
m |
|
Number of marked elements |