This documentation is archived and is not being maintained.

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
    };

IntType

The integer result type.

RealType

The floating-point engine value type.

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

Header: <random>

Namespace: std::tr1

Show: