exponential_distribution::lambda
Gibt den Lambda-Verteilungsparameter zurück.
result_type lambda() const;
Hinweise
Die Memberfunktion gibt den gespeicherten Wert stored_lambda zurück.
Beispiel
// 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);
}
Anforderungen
Header: <random>
Namespace: std