Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns the lambda distribution parameter.
result_type lambda() const;
Remarks
The member function returns the stored value stored_lambda.
Example
// std_tr1__random__exponential_distribution_lambda.cpp
// compile with: /EHsc
#include <random>
#include <iostream>
typedef std::ranlux64_base_01 Myeng;
typedef std::exponential_distribution<double> Mydist;
int main()
{
Myeng eng;
Mydist dist(1.5);
Mydist::input_type engval = eng();
Mydist::result_type distval = dist(eng);
distval = distval; // to quiet "unused" warnings
engval = engval;
std::cout << "lambda == " << dist.lambda() << std::endl;
dist.reset(); // discard any cached values
std::cout << "a random value == " << dist(eng) << std::endl;
std::cout << "a random value == " << dist(eng) << std::endl;
std::cout << "a random value == " << dist(eng) << std::endl;
return (0);
}
lambda == 1.5 a random value == 0.223809 a random value == 0.168898 a random value == 0.176395
Requirements
Header: <random>
Namespace: std
See Also
Reference
exponential_distribution Class