std::discrete_distribution<IntType>::probabilities (3) - Linux Manuals
std::discrete_distribution<IntType>::probabilities: std::discrete_distribution<IntType>::probabilities
Command to display std::discrete_distribution<IntType>::probabilities
manual in Linux: $ man 3 std::discrete_distribution<IntType>::probabilities
NAME
std::discrete_distribution<IntType>::probabilities - std::discrete_distribution<IntType>::probabilities
Synopsis
std::vector<double> probabilities() const; (since C++11)
Obtains a std::vector<double> containing the individual probabilities of each integer that is generated by this distribution.
Parameters
(none)
Return value
An object of type std::vector<double>
Example
// Run this code
#include <iostream>
#include <vector>
#include <random>
int main()
{
std::discrete_distribution<> d({40, 10, 10, 40});
std::vector<double> p = d.probabilities();
for(auto n : p)
std::cout << n << ' ';
std::cout << '\n';
}
Output:
0.4 0.1 0.1 0.4
Pages related to std::discrete_distribution<IntType>::probabilities
- std::discrete_distribution<IntType>::param (3) - std::discrete_distribution<IntType>::param
- std::discrete_distribution<IntType>::discrete_distribution (3) - std::discrete_distribution<IntType>::discrete_distribution
- std::discrete_distribution<IntType>::max (3) - std::discrete_distribution<IntType>::max
- std::discrete_distribution<IntType>::min (3) - std::discrete_distribution<IntType>::min
- std::discrete_distribution<IntType>::operator() (3) - std::discrete_distribution<IntType>::operator()
- std::discrete_distribution<IntType>::reset (3) - std::discrete_distribution<IntType>::reset
- std::discrete_distribution (3) - std::discrete_distribution
- std::discrete_distribution_param_type (3)
- std::discard_block_engine (3) - std::discard_block_engine
- std::discard_block_engine<Engine,P,R>::base (3) - std::discard_block_engine<Engine,P,R>::base
- std::discard_block_engine<Engine,P,R>::discard (3) - std::discard_block_engine<Engine,P,R>::discard
- std::discard_block_engine<Engine,P,R>::discard_block_engine (3) - std::discard_block_engine<Engine,P,R>::discard_block_engine
- std::discard_block_engine<Engine,P,R>::max (3) - std::discard_block_engine<Engine,P,R>::max