cauchy_distribution_name.a()Parameters: This function does not accepts any parameter. Return Value: The function returns the distribution parameter associated with the distribution. This parameter is known as the peak location parameter of the Cauchy distribution, which determines the shift to either side of the distribution shape. The parameter is set on construction. Below programs illustrates the cauchy_distribution::a() function in C++ STL: Program 1:
// CPP program to illustrate // cauchy_distribution::a() #include <iostream> #include <random> using namespace std;
// Driver program int main()
{ default_random_engine generator;
cauchy_distribution< double > d(0.78, 1.45);
// prints the first value
cout << "Cauchy distribution: " << d.a();
return 0;
} |
Output:
Program 2:Cauchy distribution: 0.78
// CPP program to illustrate // cauchy_distribution::a() #include <iostream> #include <random> using namespace std;
// Driver program int main()
{ default_random_engine generator;
// Define a cauchy distribution with default
// parameters a=0.0 and b=1.0
cauchy_distribution< double > d;
// prints the first value
cout << "Cauchy distribution: " << d.a();
return 0;
} |
Output:
Cauchy distribution: 0