geometric_distribution Class

Generates a geometric distribution.

template<class IntType = int, class RealType = double>
    class geometric_distribution {
public:
    typedef RealType input_type;
    typedef IntType result_type;
    explicit geometric_distribution(const RealType& p0 = RealType(0.5));
    RealType p() const;
    void reset();
    template<class Engine>
        result_type operator()(Engine& eng);
private:
    RealType stored_p;          // exposition only
    };

Parameters

  • IntType
    The integer result type.

  • RealType
    The floating-point engine value type.

Remarks

The template class decribes a distribution that produces values of a user-specified integral type with a geometric distribution.

Requirements

Header: <random>

Namespace: std::tr1

See Also

Reference

<random>

bernoulli_distribution Class

binomial_distribution Class

exponential_distribution Class

gamma_distribution Class

normal_distribution Class

poisson_distribution Class

uniform_int Class

uniform_real Class