Generates lognormally distributed random numbers.
template<typename RealType = float, typename Method = mkl::rng::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 scale);
explicit lognormal(const lognormal<RealType, Method>& other);
RealType m() const;
RealType s() const;
RealType displ() const;
RealType scale() const;
lognormal<RealType, Method>& operator=(const lognormal<RealType, Method>& other);
};
Devices supported: Host, CPU, and GPU.
The mkl::rng::lognormal class object is used in the mkl::rng::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 a, σ, b, β ∈ R ; σ > 0 , β > 0.
The probability density function is given by:
The cumulative distribution function is as follows:
typename RealType = float |
Type of the produced values. The specific values are as follows: float double |
typename Method = mkl::rng::lognormal_method::by_default |
Generation method. The specific values are as follows: mkl::rng::lognormal_method::box_muller2 mkl::rng::lognormal_method::box_muller2_accurate mkl::rng::lognormal_method::icdf mkl::rng::lognormal_method::icdf_accurate See brief descriptions of the methods in Distributions Template Parameter Method Values |
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. |