Visible to Intel only — GUID: GUID-53B6EEC9-9705-4337-9ECF-0CC26E466123
Visible to Intel only — GUID: GUID-53B6EEC9-9705-4337-9ECF-0CC26E466123
lognormal
Generates lognormally distributed random numbers.
Description
The lognormal class object is used in the generate function to provide random numbers with average of distribution (m, a) and standard deviation (s, σ) of subject normal distribution, displacement (displ, b), and scalefactor (scale, β), where .
The probability density function is given by:
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-2/CDB47C82-0322-451F-A747-A61474D916B8-low.png)
The cumulative distribution function is as follows:
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-2/555518B0-4C8C-4EE4-B536-06F340A60CC1-low.png)
API
Syntax
namespace oneapi::mkl::rng {
template<typename RealType = float,
typename Method = lognormal_method::by_default>
class lognormal {
public:
using method_type = Method;
using result_type = RealType;
lognormal(): lognormal((RealType)0.0, (RealType)1.0,
(RealType) 0.0, (RealType)1.0){}
explicit lognormal(RealType m, RealType s,
RealType displ = (RealType)0.0,
RealType scale = (RealType)1.0);
explicit lognormal(const param_type& pt);
RealType m() const;
RealType s() const;
RealType displ() const;
RealType scale() 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::lognormal_method::by_default |
Generation method. The specific values are as follows: oneapi::mkl::rng::lognormal_method::box_muller2 oneapi::mkl::rng::lognormal_method::box_muller2_accurate oneapi::mkl::rng::lognormal_method::icdf oneapi::mkl::rng::lognormal_method::icdf_accurate See brief descriptions of the methods in Distributions Template Parameter Method. |
Input Parameters
Name |
Type |
Description |
---|---|---|
m |
RealType (float, double) |
Average a of the subject normal distribution. |
s |
RealType (float, double) |
Standard deviation σ of the subject normal distribution. |
displ |
RealType (float, double) |
Displacement displ. |
scale |
RealType (float, double) |
Scalefactor scale. |