| Common mathematical functions | |||||||||||||||||||||||||||||||
| Mathematical special functions(C++17) | |||||||||||||||||||||||||||||||
| Mathematical constants(C++20) | |||||||||||||||||||||||||||||||
| Basic linear algebra algorithms(C++26) | |||||||||||||||||||||||||||||||
| Data-parallel types (SIMD)(C++26) | |||||||||||||||||||||||||||||||
| Floating-point environment(C++11) | |||||||||||||||||||||||||||||||
| Complex numbers | |||||||||||||||||||||||||||||||
Numeric array (valarray) | |||||||||||||||||||||||||||||||
| Pseudo-random number generation | |||||||||||||||||||||||||||||||
| Bit manipulation(C++20) | |||||||||||||||||||||||||||||||
| Saturation arithmetic(C++26) | |||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
| C-style checked integer arithmetic | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
discrete_distribution::discrete_distribution | ||||
| Generation | ||||
| Characteristics | ||||
| Non-member functions | ||||
(C++11)(C++11)(until C++20) | ||||
(C++11)(C++11) |
discrete_distribution(); | (1) | (since C++11) |
template<class InputIt> discrete_distribution( InputIt first, InputIt last); | (2) | (since C++11) |
discrete_distribution(std::initializer_list<double> weights); | (3) | (since C++11) |
template<class UnaryOperation> discrete_distribution(std::size_t count,double xmin,double xmax, | (4) | (since C++11) |
explicit discrete_distribution(const param_type& params); | (5) | (since C++11) |
Constructs a new distribution object.
[first, last). Iffirst== last, the effects are the same as of the default constructor.| (xmax − xmin) |
| count |
| first, last | - | the range of elements defining the numbers to use as weights. The type of the elements referred byInputIterator must be convertible todouble |
| weights | - | initializer list containing the weights |
| unary_op | - | unary operation function object that will be applied. The signature of the function should be equivalent to the following: Ret fun(const Type&a); The signature does not need to haveconst&. |
| params | - | the distribution parameter set |
| Type requirements | ||
-InputIt must meet the requirements ofLegacyInputIterator. | ||