Kommentar
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Generates a Bernoulli distribution.
class bernoulli_distribution {
public:
typedef int input_type;
typedef bool result_type;
explicit bernoulli_distribution(double p0 = 0.5);
double p() const;
void reset();
template<class Engine>
result_type operator()(Engine& eng);
private:
const double stored_p; // exposition only
};
Remarks
The class decribes a distribution that produces values of type bool, returning true with a probability given by the argument to the constructor.
Requirements
Header: <random>
Namespace: std::tr1