std::piecewise_constant_distribution (3) - Linux Man Pages
Defined in header <random>
template< class RealType = double > (since C++11)
std::piecewise_constant_distribution produces random floating-point numbers, which are uniformly distributed within each of the several subintervals [b
i+1), each with its own weight w
i. The set of interval boundaries and the set of weights are the parameters of this distribution.
The probability density for any b
i+1 - b
. where S is the sum of all weights.
std::piecewise_constant_distribution satisfies all requirements of RandomNumberDistribution
RealType - The result type generated by the generator. The effect is undefined if this is not one of float, double, or long double.
Member type Definition
param_type the type of the parameter set, see RandomNumberDistribution.
constructor (public member function)
reset (public member function)
operator() (public member function)
intervals (public member function)
param (public member function)
min (public member function)
max (public member function)
operator<< (function template)
// Run this code