1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
// discrete_distribution::param
#include <iostream>
#include <random>
int main()
{
std::default_random_engine generator;
std::discrete_distribution<int> d1 {10.0,20.0,20.0,25.0,25.0};
std::discrete_distribution<int> d2 (d1.param());
// print two independent values:
std::cout << d1(generator) << std::endl;
std::cout << d2(generator) << std::endl;
return 0;
}
|