/** * Returns a random number from the distribution. */ public int nextInt() { return nextInt(this.my_N, this.my_s, this.my_n, this.randomGenerator); }
/** * Constructs a HyperGeometric distribution. */ public HyperGeometric(int N, int s, int n, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setState(N, s, n); }
/** * Sets the uniform random number generated shared by all <b>static</b> * methods. * * @param randomGenerator * the new uniform random number generator to be shared. */ private static void xstaticSetRandomGenerator(DoubleRandomEngine randomGenerator) { synchronized (shared) { shared.setRandomGenerator(randomGenerator); } } }
c_pm = fc_lnpk(m, N_Mn, M, n); f2 = Math.exp(c_pm - fc_lnpk(k2, N_Mn, M, n)); f4 = Math.exp(c_pm - fc_lnpk(k4, N_Mn, M, n)); f1 = Math.exp(c_pm - fc_lnpk(k1, N_Mn, M, n)); f5 = Math.exp(c_pm - fc_lnpk(k5, N_Mn, M, n)); if (Math.log(W) <= c_pm - fc_lnpk(V, N_Mn, M, n)) { return (V); // final accept of V return (V); // V = k4 - Dk if (Math.log(W) <= c_pm - fc_lnpk(V, N_Mn, M, n)) { return (V); // final accept of V if (Math.log(Y) <= c_pm - fc_lnpk(X, N_Mn, M, n)) return (X);
/** * Sets the uniform random number generated shared by all <b>static</b> * methods. * * @param randomGenerator * the new uniform random number generator to be shared. */ private static void xstaticSetRandomGenerator(DoubleRandomEngine randomGenerator) { synchronized (shared) { shared.setRandomGenerator(randomGenerator); } } }
c_pm = fc_lnpk(m, N_Mn, M, n); f2 = Math.exp(c_pm - fc_lnpk(k2, N_Mn, M, n)); f4 = Math.exp(c_pm - fc_lnpk(k4, N_Mn, M, n)); f1 = Math.exp(c_pm - fc_lnpk(k1, N_Mn, M, n)); f5 = Math.exp(c_pm - fc_lnpk(k5, N_Mn, M, n)); if (Math.log(W) <= c_pm - fc_lnpk(V, N_Mn, M, n)) { return (V); // final accept of V return (V); // V = k4 - Dk if (Math.log(W) <= c_pm - fc_lnpk(V, N_Mn, M, n)) { return (V); // final accept of V if (Math.log(Y) <= c_pm - fc_lnpk(X, N_Mn, M, n)) return (X);
/** * Constructs a HyperGeometric distribution. */ public HyperGeometric(int N, int s, int n, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setState(N, s, n); }
/** * Returns a random number from the distribution. */ public static double staticNextInt(int N, int M, int n) { synchronized (shared) { return shared.nextInt(N, M, n); } }
/** * Returns a random number from the distribution. */ public int nextInt() { return nextInt(this.my_N, this.my_s, this.my_n, this.randomGenerator); }
/** * Returns a random number from the distribution. */ public static double staticNextInt(int N, int M, int n) { synchronized (shared) { return shared.nextInt(N, M, n); } }