A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/random/discrete_distribution/probabilities/ below:

public member function

<random>

std::discrete_distribution::probabilities
vector<double> probabilities() const;

Probabilities

Returns a vector with the probabilities of each of the possible values the distribution can produce, from 0 to the vector's size.

The sequence of probabilities depend on the weights specified on construction: Each potential value is assigned a probability equal to its weight divided by the sum of all weights.

There is no way to retrieve the specific weights used on construction, but only the probabilities calculated in this way.

Each individual probability is in the range [0.0,1.0], and the sum of all probabilities is always 1.0.



Parameters none

Return value A vector with the probabilities of each possible value, with the first element representing the probability of 0, and subsequent elements (if any) the probability of the subsequent integer values.

Complexity Constant.

See also
discrete_distribution::(constructor)
Construct discrete distribution (public member function)
discrete_distribution::param
Distribution parameters (public member function)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4