...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::triangle_distribution
// In header: <boost/random/triangle_distribution.hpp> template<typename RealType = double> class triangle_distribution { public: // types typedef RealType input_type; typedef RealType result_type; // construct/copy/destruct triangle_distribution(result_type = result_type(0), result_type = result_type(0.5), result_type = result_type(1)); // public member functions result_type a() const; result_type b() const; result_type c() const; void reset(); template<typename Engine> result_type operator()(Engine &); };
Instantiations of triangle_distribution
model a random distribution . A triangle_distribution
has three parameters, a
, b
, and c
, which are the smallest, the most probable and the largest values of the distribution respectively.