Generates hypergeometrically distributed random values.
template<typename IntType = std::int32_t, typename Method = mkl::rng::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 hypergeometric<IntType, Method>& other);
std::int32_t s() const;
std::int32_t m() const;
std::int32_t l() const;
hypergeometric<IntType, Method>& operator=(const hypergeometric<IntType, Method>& other);
};
Devices supported: Host and CPU
The mkl::rng::hypergeometric class object is used in the mkl::rng::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∈N∪{0}; l≥ 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:)
The cumulative distribution function is as follows:
Optimization Notice |
---|
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804 |
typename IntType = std::int32_t |
Type of the produced values. The specific values are as follows: std::int32_t std::uint32_t |
typename Method = mkl::rng:: hypergeometric_method:: by_default |
Generation method. The specific values are as follows: mkl::rng::hypergeometric_method::h2pe See brief descriptions of the methods in Distributions Template Parameter Method Values |
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. |