weibull#
Class is used for generation of Weibull distributed real types random numbers.
Description
The class object is used in the oneapi::mkl::rng::generate() function to provide random numbers Weibull distributed with displacement \(a\), scalefactor \(\beta\), and shape \(\alpha\), where \(a, \beta, \alpha \in R; \alpha > 0; \beta > 0\).
The probability distribution is given by:
The cumulative distribution function is as follows:
class weibull#
Syntax
namespace oneapi::mkl::rng {
template<typename RealType = float, typename Method = weibull_method::by_default>
class weibull {
public:
    using method_type = Method;
    using result_type = RealType;
    weibull();
    explicit weibull(RealType alpha, RealType a, RealType b);
    RealType alpha() const;
    RealType a() const;
    RealType beta() const;
};
}
Template parameters
- typename RealType
 - Type of the produced values. Supported types:
 floatdouble
- typename Method = oneapi::mkl::rng::weibull_method::by_default
 Transformation method, which will be used for generation. Supported types:
oneapi::mkl::rng::weibull_method::by_defaultoneapi::mkl::rng::weibull_method::icdfoneapi::mkl::rng::weibull_method::icdf_accurate
See description of the methods in Distributions methods template parameter.
Class Members
Routine  | 
Description  | 
|---|---|
Default constructor  | 
|
Constructor with parameters  | 
|
Method to obtain shape value  | 
|
Method to obtain displacement value  | 
|
Method to obtain scalefactor value  | 
Member types
weibull::method_type = Method
Description
The type which defines transformation method for generation.
weibull::result_type = RealType
Description
The type which defines type of generated random numbers.
Constructors
weibull::weibull()
Description
Default constructor for distribution, parameters set as alpha = 1.0, a = 0.0, and b = 1.0.
explicit weibull::weibull(RealType alpha, RealType a, RealType beta)
Description
Constructor with parameters. alpha is a shape value, a is a displacement value, beta is a scalefactor value.
Throws
- oneapi::mkl::invalid_argument
 Exception is thrown when \(alpha \leq\) static_cast<RealType>(0.0), or \(beta \leq\) static_cast<RealType>(0.0)
Characteristics
RealType weibull::alpha() const
Return Value
Returns the distribution parameter alpha - shape value.
RealType weibull::a() const
Return Value
Returns the distribution parameter a - displacement value.
RealType weibull::beta() const
Return Value
Returns the distribution parameter beta - scalefactor value.
Parent topic: Host Distributions