public member function
<random>
std::uniform_real_distribution::param (1)param_type param() const;(2)
void param (const param_type& parm);
Distribution parameters
The first version (1) returns an object with the parameters currently associated with the distribution object.A uniform_real_distribution is defined by two parameters: a and b, which specify the lower and upper bounds of the range of possible values generated by the distribution. An object of type param_type carries this information, but it is meant to be used only to construct or specify the parameters for a uniform_real_distribution object, not to inspect the individual parameters.
To inspect the individual parameters associated to the distribution object you can use: uniform_real_distribution::a and uniform_real_distribution::b.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// uniform_real_distribution::param
#include <iostream>
#include <random>
int main()
{
std::default_random_engine generator;
std::uniform_real_distribution<double> d1(0.0,100.0);
std::uniform_real_distribution<double> d2(d1.param());
// print two independent values:
std::cout << d1(generator) << std::endl;
std::cout << d2(generator) << std::endl;
return 0;
}
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