Example #1
0
 /**
  * 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());
 }
Example #2
0
 /**
  * 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());
 }