Share via


piecewise_linear_distribution::operator()

Returns a random value.

template<class Engine>
    result_type operator()(Engine& eng);
template<class Engine>
    result_type operator()(Engine& eng,
        const param_type& par0);

Parameters

  • eng
    The random engine.

  • par0
    The parameter package used to return the random value.

Remarks

The first member operator uses the engine eng as a source of uniformly distributed random integral values and returns floating-point values with each value x in the range [stored_x.front(), stored_x.back()) occurring with probability determined by the smallest element I for which x < stored_x[I + 1}, and other values of x occurring with probability zero. Values x are uniformly distributed over the range [stored_x[I], stored_x[I + 1]) with probability varying from stored_p[I] to stored_p[I + 1].

The second member function behaves the same, except that it uses the parameters stored in par0.

Requirements

Header: <random>

Namespace: std

See Also

Reference

<random>

piecewise_linear_distribution Class

Other Resources

<random> Members