...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::geometric_distribution
// In header: <boost/random/geometric_distribution.hpp> template<typename IntType = int, typename RealType = double> class geometric_distribution { public: // types typedef RealType input_type; typedef IntType result_type; // construct/copy/destruct geometric_distribution(const RealType & = RealType(0.5)); // public member functions RealType p() const; void reset(); template<typename Engine> result_type operator()(Engine &); };
An instantiation of the class template geometric_distribution
models a random distribution . The distribution produces positive integers which are the number of bernoulli trials with probability p
required to get one that fails.
For the geometric distribution, .