Visible to Intel only — GUID: GUID-73748AF0-EDB7-4BEC-B46C-A8709D5F803D
Visible to Intel only — GUID: GUID-73748AF0-EDB7-4BEC-B46C-A8709D5F803D
chi_square
Generates chi-square distributed random values.
Description
The chi_square class object is used in the generate function to provide random numbers with chi-square distribution and ν degrees of freedom, .
The probability density function is:
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-2/A509B4D8-95D4-4F84-A6B6-E98C470B1F13-low.png)
The cumulative distribution function is:
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-2/B7F0E673-11B8-4C4F-983A-80E6B546E0D7-low.png)
API
Syntax
namespace oneapi::mkl::rng {
template<typename RealType = float,
typename Method = chi_square_method::by_default>
class chi_square {
public:
using method_type = Method;
using result_type = RealType;
chi_square(): chi_square(5){}
explicit chi_square(std::int32_t n);
explicit chi_square(const param_type& pt);
std::int32_t n() 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 RealType = float |
Type of the produced values. The specific values are as follows: float double |
typename Method = oneapi::mkl::rng::chi_square_method::by_default |
Generation method. The specific values are as follows: oneapi::mkl::rng::chi_square_method::gamma_based See brief descriptions of the methods in Distributions Template Parameter Method. |
Input Parameters
Name |
Type |
Description |
---|---|---|
n |
std::int32_t |
Degrees of freedom. |