/** * Generates a new integer from the *Bernoulli* distribution with parameter @f$p = @f$ `p`, * using the given stream `s`. */ public static int nextInt(RandomStream s, double p) { return BernoulliDist.inverseF(p, s.nextDouble()); }
/** * Creates a random variate generator for the *Bernoulli* distribution `dist` and the random * stream `s`. */ public BernoulliGen(RandomStream s, BernoulliDist dist) { super(s, dist); if (dist != null) setParams(dist.getP()); }