You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ch...@apache.org on 2018/08/06 12:16:42 UTC

[01/12] commons-rng git commit: Add license text.

Repository: commons-rng
Updated Branches:
  refs/heads/1.1 f73546863 -> 406a41d33


Add license text.


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/b9089a83
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/b9089a83
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/b9089a83

Branch: refs/heads/1.1
Commit: b9089a83a9e738c348a1dff8b769f17fdd8b7079
Parents: f33ea24
Author: Gilles <er...@apache.org>
Authored: Wed Aug 1 11:26:11 2018 +0200
Committer: Gilles <er...@apache.org>
Committed: Wed Aug 1 11:36:49 2018 +0200

----------------------------------------------------------------------
 commons-rng-examples/examples-jpms/runApp.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/b9089a83/commons-rng-examples/examples-jpms/runApp.sh
----------------------------------------------------------------------
diff --git a/commons-rng-examples/examples-jpms/runApp.sh b/commons-rng-examples/examples-jpms/runApp.sh
index d55ba4f..886209d 100755
--- a/commons-rng-examples/examples-jpms/runApp.sh
+++ b/commons-rng-examples/examples-jpms/runApp.sh
@@ -1,5 +1,20 @@
 #!/bin/bash -e
 
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 # Script assumes that the JAR files have all been generated (e.g. by calling
 # "mvn package" from the top level project directory).
 


[03/12] commons-rng git commit: RNG-50: PoissonSampler speed improvements

Posted by ch...@apache.org.
RNG-50: PoissonSampler speed improvements

The algorithms for small mean and large mean have been separated into
dedicated classes. Caching of constants used in the algorithm has been
used to increase speed.

Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/7b4a4142
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/7b4a4142
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/7b4a4142

Branch: refs/heads/1.1
Commit: 7b4a41428c2bed270261b4fedd3a562adaee04b5
Parents: f33ea24
Author: aherbert <a....@sussex.ac.uk>
Authored: Wed Aug 1 12:09:28 2018 +0100
Committer: aherbert <a....@sussex.ac.uk>
Committed: Wed Aug 1 12:09:28 2018 +0100

----------------------------------------------------------------------
 .../distribution/LargeMeanPoissonSampler.java   | 184 +++++++++++++++++++
 .../sampling/distribution/PoissonSampler.java   | 136 ++------------
 .../distribution/SmallMeanPoissonSampler.java   |  85 +++++++++
 .../distribution/DiscreteSamplersList.java      |  13 +-
 4 files changed, 293 insertions(+), 125 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/7b4a4142/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
new file mode 100644
index 0000000..c861802
--- /dev/null
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.rng.sampling.distribution;
+
+import org.apache.commons.rng.UniformRandomProvider;
+import org.apache.commons.rng.sampling.distribution.InternalUtils.FactorialLog;
+
+/**
+ * Sampler for the <a href="http://mathworld.wolfram.com/PoissonDistribution.html">Poisson distribution</a>.
+ *
+ * <ul>
+ *  <li>
+ *   For large means, we use the rejection algorithm described in
+ *   <blockquote>
+ *    Devroye, Luc. (1981).<i>The Computer Generation of Poisson Random Variables</i><br>
+ *    <strong>Computing</strong> vol. 26 pp. 197-207.
+ *   </blockquote>
+ *  </li>
+ * </ul>
+ * 
+ * This sampler is suitable for {@code mean >= 40}.
+ */
+public class LargeMeanPoissonSampler
+    extends SamplerBase
+    implements DiscreteSampler {
+
+    /** Class to compute {@code log(n!)}. This has no cached values. */
+    static private final InternalUtils.FactorialLog NO_CACHE_FACTORIAL_LOG;
+
+    static {
+        // Create without a cache.
+        NO_CACHE_FACTORIAL_LOG = FactorialLog.create();
+    }
+
+    /** Exponential. */
+    private final ContinuousSampler exponential;
+    /** Gaussian. */
+    private final ContinuousSampler gaussian;
+    /** Local class to compute {@code log(n!)}. This may have cached values. */
+    private final InternalUtils.FactorialLog factorialLog;
+ 
+    // Working values
+    private final double lambda;
+    private final double lambdaFractional;
+    private final double logLambda;
+    private final double logLambdaFactorial;
+    private final double delta;
+    private final double halfDelta;
+    private final double twolpd;
+    private final double p1;
+    private final double p2;
+    private final double c1;
+
+    /** The internal Poisson sampler for the lambda fraction. */
+    private final DiscreteSampler smallMeanPoissonSampler;
+
+    /**
+     * @param rng  Generator of uniformly distributed random numbers.
+     * @param mean Mean.
+     * @throws IllegalArgumentException if {@code mean <= 0}.
+     */
+    public LargeMeanPoissonSampler(UniformRandomProvider rng, 
+    		                       double mean) {
+        super(rng);
+        if (mean <= 0) {
+            throw new IllegalArgumentException(mean + " <= " + 0);
+        }
+        
+        gaussian = new ZigguratNormalizedGaussianSampler(rng);
+        exponential = new AhrensDieterExponentialSampler(rng, 1);
+        // Plain constructor uses the uncached function.
+        factorialLog = NO_CACHE_FACTORIAL_LOG;
+
+        // Cache values used in the algorithm
+        lambda = Math.floor(mean);
+        lambdaFractional = mean - lambda;
+        logLambda = Math.log(lambda);
+        logLambdaFactorial = factorialLog((int) lambda);
+        delta = Math.sqrt(lambda * Math.log(32 * lambda / Math.PI + 1));
+        halfDelta = delta / 2;
+        twolpd = 2 * lambda + delta;
+        c1 = 1 / (8 * lambda);
+        final double a1 = Math.sqrt(Math.PI * twolpd) * Math.exp(c1);
+        final double a2 = (twolpd / delta) * Math.exp(-delta * (1 + delta) / twolpd);
+        final double aSum = a1 + a2 + 1;
+        p1 = a1 / aSum;
+        p2 = a2 / aSum;
+
+        // The algorithm requires a Poisson sample from the remaining lambda fraction.
+        smallMeanPoissonSampler = (lambdaFractional < Double.MIN_VALUE) ?
+            null : // Not used.
+            new SmallMeanPoissonSampler(rng, lambdaFractional);
+    }
+    
+    /** {@inheritDoc} */
+    @Override
+    public int sample() {
+
+        final int y2 = (smallMeanPoissonSampler == null) ? 
+            0 : // No lambda fraction
+            smallMeanPoissonSampler.sample();
+        
+        double x = 0;
+        double y = 0;
+        double v = 0;
+        int a = 0;
+        double t = 0;
+        double qr = 0;
+        double qa = 0;
+        while (true) {
+            final double u = nextDouble();
+            if (u <= p1) {
+                final double n = gaussian.sample();
+                x = n * Math.sqrt(lambda + halfDelta) - 0.5d;
+                if (x > delta || x < -lambda) {
+                    continue;
+                }
+                y = x < 0 ? Math.floor(x) : Math.ceil(x);
+                final double e = exponential.sample();
+                v = -e - 0.5 * n * n + c1;
+            } else {
+                if (u > p1 + p2) {
+                    y = lambda;
+                    break;
+                }
+                x = delta + (twolpd / delta) * exponential.sample();
+                y = Math.ceil(x);
+                v = -exponential.sample() - delta * (x + 1) / twolpd;
+            }
+            a = x < 0 ? 1 : 0;
+            t = y * (y + 1) / (2 * lambda);
+            if (v < -t && a == 0) {
+                y = lambda + y;
+                break;
+            }
+            qr = t * ((2 * y + 1) / (6 * lambda) - 1);
+            qa = qr - (t * t) / (3 * (lambda + a * (y + 1)));
+            if (v < qa) {
+                y = lambda + y;
+                break;
+            }
+            if (v > qr) {
+                continue;
+            }
+            if (v < y * logLambda - factorialLog((int) (y + lambda)) + logLambdaFactorial) {
+                y = lambda + y;
+                break;
+            }
+        }
+        
+        return (int) Math.min(y2 + (long) y, Integer.MAX_VALUE);
+    }
+
+    /**
+     * Compute the natural logarithm of the factorial of {@code n}.
+     *
+     * @param n Argument.
+     * @return {@code log(n!)}
+     * @throws IllegalArgumentException if {@code n < 0}.
+     */
+    private final double factorialLog(int n) {
+        return factorialLog.value(n);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String toString() {
+        return "Large Mean Poisson deviate [" + super.toString() + "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/7b4a4142/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
index 195e725..cf7d9ac 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
@@ -30,51 +30,38 @@ import org.apache.commons.rng.UniformRandomProvider;
  *  <li>
  *   For large means, we use the rejection algorithm described in
  *   <blockquote>
- *    Devroye, Luc. (1981).<i>The Computer Generation of Poisson Random Variables</i><br>
+ *    Devroye, Luc. (1981). <i>The Computer Generation of Poisson Random Variables</i><br>
  *    <strong>Computing</strong> vol. 26 pp. 197-207.
  *   </blockquote>
  *  </li>
  * </ul>
  */
 public class PoissonSampler
-    extends SamplerBase
     implements DiscreteSampler {
+
     /** Value for switching sampling algorithm. */
-    private static final double PIVOT = 40;
-    /** Mean of the distribution. */
-    private final double mean;
-    /** Exponential. */
-    private final ContinuousSampler exponential;
-    /** Gaussian. */
-    private final NormalizedGaussianSampler gaussian;
-    /** {@code log(n!)}. */
-    private final InternalUtils.FactorialLog factorialLog;
+    static final double PIVOT = 40;
+    /** The internal Poisson sampler. */
+    private final DiscreteSampler poissonSampler;
 
     /**
-     * @param rng Generator of uniformly distributed random numbers.
+     * @param rng  Generator of uniformly distributed random numbers.
      * @param mean Mean.
      * @throws IllegalArgumentException if {@code mean <= 0}.
      */
     public PoissonSampler(UniformRandomProvider rng,
                           double mean) {
-        super(rng);
-        if (mean <= 0) {
-            throw new IllegalArgumentException(mean + " <= " + 0);
-        }
-
-        this.mean = mean;
-
-        gaussian = new ZigguratNormalizedGaussianSampler(rng);
-        exponential = new AhrensDieterExponentialSampler(rng, 1);
-        factorialLog = mean < PIVOT ?
-            null : // Not used.
-            InternalUtils.FactorialLog.create().withCache((int) Math.min(mean, 2 * PIVOT));
+        // Delegate all work to specialised samplers.
+        // These should check the input arguments.
+        poissonSampler = mean < PIVOT ?
+            new SmallMeanPoissonSampler(rng, mean) :
+            new LargeMeanPoissonSampler(rng, mean);
     }
 
     /** {@inheritDoc} */
     @Override
     public int sample() {
-        return (int) Math.min(nextPoisson(mean), Integer.MAX_VALUE);
+        return poissonSampler.sample();
     }
 
     /** {@inheritDoc} */
@@ -82,103 +69,4 @@ public class PoissonSampler
     public String toString() {
         return "Poisson deviate [" + super.toString() + "]";
     }
-
-    /**
-     * @param meanPoisson Mean.
-     * @return the next sample.
-     */
-    private long nextPoisson(double meanPoisson) {
-        if (meanPoisson < PIVOT) {
-            double p = Math.exp(-meanPoisson);
-            long n = 0;
-            double r = 1;
-
-            while (n < 1000 * meanPoisson) {
-                r *= nextDouble();
-                if (r >= p) {
-                    n++;
-                } else {
-                    break;
-                }
-            }
-            return n;
-        } else {
-            final double lambda = Math.floor(meanPoisson);
-            final double lambdaFractional = meanPoisson - lambda;
-            final double logLambda = Math.log(lambda);
-            final double logLambdaFactorial = factorialLog((int) lambda);
-            final long y2 = lambdaFractional < Double.MIN_VALUE ? 0 : nextPoisson(lambdaFractional);
-            final double delta = Math.sqrt(lambda * Math.log(32 * lambda / Math.PI + 1));
-            final double halfDelta = delta / 2;
-            final double twolpd = 2 * lambda + delta;
-            final double a1 = Math.sqrt(Math.PI * twolpd) * Math.exp(1 / (8 * lambda));
-            final double a2 = (twolpd / delta) * Math.exp(-delta * (1 + delta) / twolpd);
-            final double aSum = a1 + a2 + 1;
-            final double p1 = a1 / aSum;
-            final double p2 = a2 / aSum;
-            final double c1 = 1 / (8 * lambda);
-
-            double x;
-            double y;
-            double v;
-            int a;
-            double t;
-            double qr;
-            double qa;
-            while (true) {
-                final double u = nextDouble();
-                if (u <= p1) {
-                    final double n = gaussian.sample();
-                    x = n * Math.sqrt(lambda + halfDelta) - 0.5;
-                    if (x > delta ||
-                        x < -lambda) {
-                        continue;
-                    }
-                    y = x < 0 ? Math.floor(x) : Math.ceil(x);
-                    final double e = exponential.sample();
-                    v = -e - 0.5 * n * n + c1;
-                } else {
-                    if (u > p1 + p2) {
-                        y = lambda;
-                        break;
-                    } else {
-                        x = delta + (twolpd / delta) * exponential.sample();
-                        y = Math.ceil(x);
-                        v = -exponential.sample() - delta * (x + 1) / twolpd;
-                    }
-                }
-                a = x < 0 ? 1 : 0;
-                t = y * (y + 1) / (2 * lambda);
-                if (v < -t && a == 0) {
-                    y = lambda + y;
-                    break;
-                }
-                qr = t * ((2 * y + 1) / (6 * lambda) - 1);
-                qa = qr - (t * t) / (3 * (lambda + a * (y + 1)));
-                if (v < qa) {
-                    y = lambda + y;
-                    break;
-                }
-                if (v > qr) {
-                    continue;
-                }
-                if (v < y * logLambda - factorialLog((int) (y + lambda)) + logLambdaFactorial) {
-                    y = lambda + y;
-                    break;
-                }
-            }
-            return y2 + (long) y;
-        }
-    }
-
-    /**
-     * Compute the natural logarithm of the factorial of {@code n}.
-     *
-     * @param n Argument.
-     * @return {@code log(n!)}
-     * @throws IllegalArgumentException if {@code n < 0}.
-     */
-    private double factorialLog(int n) {
-        return factorialLog.value(n);
-    }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/7b4a4142/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSampler.java
new file mode 100644
index 0000000..9f47c76
--- /dev/null
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSampler.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.rng.sampling.distribution;
+
+import org.apache.commons.rng.UniformRandomProvider;
+
+/**
+ * Sampler for the <a href="http://mathworld.wolfram.com/PoissonDistribution.html">Poisson distribution</a>.
+ *
+ * <ul>
+ *  <li>
+ *   For small means, a Poisson process is simulated using uniform deviates, as
+ *   described <a href="http://mathaa.epfl.ch/cours/PMMI2001/interactive/rng7.htm">here</a>.
+ *   The Poisson process (and hence, the returned value) is bounded by 1000 * mean.
+ *  </li>
+ * </ul>
+ * 
+ * This sampler is suitable for {@code mean < 40}.
+ */
+public class SmallMeanPoissonSampler
+    extends SamplerBase
+    implements DiscreteSampler {
+
+    /** 
+     * Pre-compute {@code Math.exp(-mean)}. 
+     * Note: This is the probability of the Poisson sample {@code P(n=0)}.
+     */
+    private final double p0;
+    /** Pre-compute {@code 1000 * mean} as the upper limit of the sample. */
+    private final int limit;
+
+    /**
+     * @param rng  Generator of uniformly distributed random numbers.
+     * @param mean Mean.
+     * @throws IllegalArgumentException if {@code mean <= 0}.
+     */
+    public SmallMeanPoissonSampler(UniformRandomProvider rng,
+                                   double mean) {
+        super(rng);
+        if (mean <= 0) {
+            throw new IllegalArgumentException(mean + " <= " + 0);
+        }
+        
+        p0 = Math.exp(-mean);
+        // The returned sample is bounded by 1000 * mean or Integer.MAX_VALUE
+        limit = (int) Math.ceil(Math.min(1000 * mean, Integer.MAX_VALUE));
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public int sample() {
+        int n = 0;
+        double r = 1;
+
+        while (n < limit) {
+            r *= nextDouble();
+            if (r >= p0) {
+                n++;
+            } else {
+                break;
+            }
+        }
+        return n;
+    }
+    
+    /** {@inheritDoc} */
+    @Override
+    public String toString() {
+        return "Small Mean Poisson deviate [" + super.toString() + "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/7b4a4142/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
index 2c02bdb..23122c7 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/DiscreteSamplersList.java
@@ -16,7 +16,6 @@
  */
 package org.apache.commons.rng.sampling.distribution;
 
-import java.util.Arrays;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -109,16 +108,28 @@ public class DiscreteSamplersList {
             add(LIST, new org.apache.commons.math3.distribution.PoissonDistribution(meanPoisson),
                 MathArrays.sequence(10, 0, 1),
                 new PoissonSampler(RandomSource.create(RandomSource.KISS), meanPoisson));
+            // Dedicated small mean poisson sampler
+            add(LIST, new org.apache.commons.math3.distribution.PoissonDistribution(meanPoisson),
+                MathArrays.sequence(10, 0, 1),
+                new SmallMeanPoissonSampler(RandomSource.create(RandomSource.KISS), meanPoisson));
             // Poisson (40 < mean < 80).
             final double largeMeanPoisson = 67.89;
             add(LIST, new org.apache.commons.math3.distribution.PoissonDistribution(largeMeanPoisson),
                 MathArrays.sequence(50, (int) (largeMeanPoisson - 25), 1),
                 new PoissonSampler(RandomSource.create(RandomSource.SPLIT_MIX_64), largeMeanPoisson));
+            // Dedicated large mean poisson sampler
+            add(LIST, new org.apache.commons.math3.distribution.PoissonDistribution(largeMeanPoisson),
+                MathArrays.sequence(50, (int) (largeMeanPoisson - 25), 1),
+                new LargeMeanPoissonSampler(RandomSource.create(RandomSource.SPLIT_MIX_64), largeMeanPoisson));
             // Poisson (mean >> 40).
             final double veryLargeMeanPoisson = 543.21;
             add(LIST, new org.apache.commons.math3.distribution.PoissonDistribution(veryLargeMeanPoisson),
                 MathArrays.sequence(100, (int) (veryLargeMeanPoisson - 50), 1),
                 new PoissonSampler(RandomSource.create(RandomSource.SPLIT_MIX_64), veryLargeMeanPoisson));
+            // Dedicated large mean poisson sampler
+            add(LIST, new org.apache.commons.math3.distribution.PoissonDistribution(veryLargeMeanPoisson),
+                MathArrays.sequence(100, (int) (veryLargeMeanPoisson - 50), 1),
+                new LargeMeanPoissonSampler(RandomSource.create(RandomSource.SPLIT_MIX_64), veryLargeMeanPoisson));
         } catch (Exception e) {
             System.err.println("Unexpected exception while creating the list of samplers: " + e);
             e.printStackTrace(System.err);


[07/12] commons-rng git commit: Make field "private".

Posted by ch...@apache.org.
Make field "private".


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/96a380ee
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/96a380ee
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/96a380ee

Branch: refs/heads/1.1
Commit: 96a380ee435d21656302526d23bb1e3f52bdb991
Parents: ae7a63a
Author: Gilles <er...@apache.org>
Authored: Thu Aug 2 13:44:26 2018 +0200
Committer: Gilles <er...@apache.org>
Committed: Thu Aug 2 13:44:26 2018 +0200

----------------------------------------------------------------------
 .../apache/commons/rng/sampling/distribution/PoissonSampler.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/96a380ee/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
index cf7d9ac..a12cbb9 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
@@ -40,7 +40,7 @@ public class PoissonSampler
     implements DiscreteSampler {
 
     /** Value for switching sampling algorithm. */
-    static final double PIVOT = 40;
+    private static final double PIVOT = 40;
     /** The internal Poisson sampler. */
     private final DiscreteSampler poissonSampler;
 


[10/12] commons-rng git commit: RNG-50 will make it into version 1.1.

Posted by ch...@apache.org.
RNG-50 will make it into version 1.1.


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/edb3eed7
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/edb3eed7
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/edb3eed7

Branch: refs/heads/1.1
Commit: edb3eed76e5a50ddce94dd5510f0c9d2f54be35a
Parents: 4644028
Author: Gilles <er...@apache.org>
Authored: Sat Aug 4 20:39:19 2018 +0200
Committer: Gilles <er...@apache.org>
Committed: Sat Aug 4 20:39:19 2018 +0200

----------------------------------------------------------------------
 src/changes/changes.xml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/edb3eed7/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d202a20..262d7f6 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -71,14 +71,8 @@ Additional code is provided in the following module:
 It is however not part of the official API and no compatibility
 should be expected in subsequent releases.
 ">
-      <action dev="erans" type="update" issue="RNG-50" due-to="Alex D. Herbert">
-	"PoissonSampler": Algorithms for small mean and large mean have
-	been separated into dedicated classes.  Cache precomputation has
-	been disabled as it is only marginally used and is a performance
-	hit for small sampling sets.
-      </action>
     </release>
-    
+
     <release version="1.1" date="2018-08-05" description="
 This is a minor release of Apache Commons RNG, containing a
 few new features and performance improvements.
@@ -104,6 +98,12 @@ of random number generation.  The 'maven-surefire-plugin' can be configured
 to re-run tests that fail and pass the build if they succeed (the test will
 be marked as 'flaky' in the report).
 ">
+      <action dev="erans" type="update" issue="RNG-50" due-to="Alex D. Herbert">
+	"PoissonSampler": Algorithms for small mean and large mean have
+	been separated into dedicated classes.  Cache precomputation has
+	been disabled as it is only marginally used and is a performance
+	hit for small sampling sets.
+      </action>
       <action dev="erans" type="add" issue="RNG-37">
         Implementation of the "Ziggurat" algorithm for Gaussian sampling.
       </action>


[05/12] commons-rng git commit: Merge branch 'master' into RNG-50__alex

Posted by ch...@apache.org.
Merge branch 'master' into RNG-50__alex


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/1d1ed4bd
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/1d1ed4bd
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/1d1ed4bd

Branch: refs/heads/1.1
Commit: 1d1ed4bd8422d36decf5eeb4838a0d4cdc1ddec8
Parents: 9704699 919311f
Author: Gilles <er...@apache.org>
Authored: Thu Aug 2 10:49:08 2018 +0200
Committer: Gilles <er...@apache.org>
Committed: Thu Aug 2 10:49:08 2018 +0200

----------------------------------------------------------------------
 commons-rng-examples/examples-jpms/runApp.sh | 15 +++++++++++++++
 src/changes/changes.xml                      | 13 ++++++++++---
 2 files changed, 25 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[04/12] commons-rng git commit: RNG-50: PoissonSampler speed improvements

Posted by ch...@apache.org.
RNG-50: PoissonSampler speed improvements

Fixed checkstyle errors

Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/9704699b
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/9704699b
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/9704699b

Branch: refs/heads/1.1
Commit: 9704699b403f23939529e14b0560cabf00530d98
Parents: 7b4a414
Author: aherbert <a....@sussex.ac.uk>
Authored: Wed Aug 1 12:40:04 2018 +0100
Committer: aherbert <a....@sussex.ac.uk>
Committed: Wed Aug 1 12:40:04 2018 +0100

----------------------------------------------------------------------
 .../distribution/LargeMeanPoissonSampler.java   | 45 +++++++++++++++-----
 .../distribution/SmallMeanPoissonSampler.java   | 10 ++---
 2 files changed, 39 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9704699b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
index c861802..a729686 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.java
@@ -31,7 +31,7 @@ import org.apache.commons.rng.sampling.distribution.InternalUtils.FactorialLog;
  *   </blockquote>
  *  </li>
  * </ul>
- * 
+ *
  * This sampler is suitable for {@code mean >= 40}.
  */
 public class LargeMeanPoissonSampler
@@ -39,7 +39,7 @@ public class LargeMeanPoissonSampler
     implements DiscreteSampler {
 
     /** Class to compute {@code log(n!)}. This has no cached values. */
-    static private final InternalUtils.FactorialLog NO_CACHE_FACTORIAL_LOG;
+    private static final InternalUtils.FactorialLog NO_CACHE_FACTORIAL_LOG;
 
     static {
         // Create without a cache.
@@ -52,17 +52,40 @@ public class LargeMeanPoissonSampler
     private final ContinuousSampler gaussian;
     /** Local class to compute {@code log(n!)}. This may have cached values. */
     private final InternalUtils.FactorialLog factorialLog;
- 
+
     // Working values
+
+    /** Algorithm constant: {@code Math.floor(mean)}. */
     private final double lambda;
+    /** Algorithm constant: {@code mean - lambda}. */
     private final double lambdaFractional;
+    /** Algorithm constant: {@code Math.log(lambda)}. */
     private final double logLambda;
+    /** Algorithm constant: {@code factorialLog((int) lambda)}. */
     private final double logLambdaFactorial;
+    /** Algorithm constant: {@code Math.sqrt(lambda * Math.log(32 * lambda / Math.PI + 1))}. */
     private final double delta;
+    /** Algorithm constant: {@code delta / 2}. */
     private final double halfDelta;
+    /** Algorithm constant: {@code 2 * lambda + delta}. */
     private final double twolpd;
+    /**
+     * Algorithm constant: {@code a1 / aSum} with
+     * <ul>
+     *  <li>{@code a1 = Math.sqrt(Math.PI * twolpd) * Math.exp(c1)}</li>
+     *  <li>{@code aSum = a1 + a2 + 1}</li>
+     * </ul>
+     */
     private final double p1;
+    /**
+     * Algorithm constant: {@code a1 / aSum} with
+     * <ul>
+     *  <li>{@code a2 = (twolpd / delta) * Math.exp(-delta * (1 + delta) / twolpd)}</li>
+     *  <li>{@code aSum = a1 + a2 + 1}</li>
+     * </ul>
+     */
     private final double p2;
+    /** Algorithm constant: {@code 1 / (8 * lambda)}. */
     private final double c1;
 
     /** The internal Poisson sampler for the lambda fraction. */
@@ -73,13 +96,13 @@ public class LargeMeanPoissonSampler
      * @param mean Mean.
      * @throws IllegalArgumentException if {@code mean <= 0}.
      */
-    public LargeMeanPoissonSampler(UniformRandomProvider rng, 
-    		                       double mean) {
+    public LargeMeanPoissonSampler(UniformRandomProvider rng,
+                                   double mean) {
         super(rng);
         if (mean <= 0) {
             throw new IllegalArgumentException(mean + " <= " + 0);
         }
-        
+
         gaussian = new ZigguratNormalizedGaussianSampler(rng);
         exponential = new AhrensDieterExponentialSampler(rng, 1);
         // Plain constructor uses the uncached function.
@@ -105,15 +128,15 @@ public class LargeMeanPoissonSampler
             null : // Not used.
             new SmallMeanPoissonSampler(rng, lambdaFractional);
     }
-    
+
     /** {@inheritDoc} */
     @Override
     public int sample() {
 
-        final int y2 = (smallMeanPoissonSampler == null) ? 
+        final int y2 = (smallMeanPoissonSampler == null) ?
             0 : // No lambda fraction
             smallMeanPoissonSampler.sample();
-        
+
         double x = 0;
         double y = 0;
         double v = 0;
@@ -161,7 +184,7 @@ public class LargeMeanPoissonSampler
                 break;
             }
         }
-        
+
         return (int) Math.min(y2 + (long) y, Integer.MAX_VALUE);
     }
 
@@ -172,7 +195,7 @@ public class LargeMeanPoissonSampler
      * @return {@code log(n!)}
      * @throws IllegalArgumentException if {@code n < 0}.
      */
-    private final double factorialLog(int n) {
+    private double factorialLog(int n) {
         return factorialLog.value(n);
     }
 

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9704699b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSampler.java
index 9f47c76..283594e 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/SmallMeanPoissonSampler.java
@@ -28,15 +28,15 @@ import org.apache.commons.rng.UniformRandomProvider;
  *   The Poisson process (and hence, the returned value) is bounded by 1000 * mean.
  *  </li>
  * </ul>
- * 
+ *
  * This sampler is suitable for {@code mean < 40}.
  */
 public class SmallMeanPoissonSampler
     extends SamplerBase
     implements DiscreteSampler {
 
-    /** 
-     * Pre-compute {@code Math.exp(-mean)}. 
+    /**
+     * Pre-compute {@code Math.exp(-mean)}.
      * Note: This is the probability of the Poisson sample {@code P(n=0)}.
      */
     private final double p0;
@@ -54,7 +54,7 @@ public class SmallMeanPoissonSampler
         if (mean <= 0) {
             throw new IllegalArgumentException(mean + " <= " + 0);
         }
-        
+
         p0 = Math.exp(-mean);
         // The returned sample is bounded by 1000 * mean or Integer.MAX_VALUE
         limit = (int) Math.ceil(Math.min(1000 * mean, Integer.MAX_VALUE));
@@ -76,7 +76,7 @@ public class SmallMeanPoissonSampler
         }
         return n;
     }
-    
+
     /** {@inheritDoc} */
     @Override
     public String toString() {


[09/12] commons-rng git commit: Nit.

Posted by ch...@apache.org.
Nit.


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/4644028f
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/4644028f
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/4644028f

Branch: refs/heads/1.1
Commit: 4644028f96cb6c5a18bd5bf5996ef0048c55a529
Parents: 1bab183
Author: Gilles <er...@apache.org>
Authored: Sat Aug 4 19:20:21 2018 +0200
Committer: Gilles <er...@apache.org>
Committed: Sat Aug 4 19:20:21 2018 +0200

----------------------------------------------------------------------
 .../apache/commons/rng/sampling/distribution/PoissonSampler.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/4644028f/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
index a12cbb9..cd9187a 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/PoissonSampler.java
@@ -45,7 +45,7 @@ public class PoissonSampler
     private final DiscreteSampler poissonSampler;
 
     /**
-     * @param rng  Generator of uniformly distributed random numbers.
+     * @param rng Generator of uniformly distributed random numbers.
      * @param mean Mean.
      * @throws IllegalArgumentException if {@code mean <= 0}.
      */


[06/12] commons-rng git commit: Track changes.

Posted by ch...@apache.org.
Track changes.


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/ae7a63ac
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/ae7a63ac
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/ae7a63ac

Branch: refs/heads/1.1
Commit: ae7a63acfb10aed653ec5d4ad2aef61a1263e3ba
Parents: 1d1ed4b
Author: Gilles <er...@apache.org>
Authored: Thu Aug 2 12:19:43 2018 +0200
Committer: Gilles <er...@apache.org>
Committed: Thu Aug 2 12:19:43 2018 +0200

----------------------------------------------------------------------
 src/changes/changes.xml | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/ae7a63ac/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 4419dc7..d202a20 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -52,6 +52,33 @@ If the output is not quite correct, check for invisible trailing spaces!
   <body>
 
 
+    <release version="1.2" date="TBD" description="
+This is a minor release of Apache Commons RNG, containing a
+few new features and performance improvements.
+
+Apache Commons RNG 1.2 contains the following library modules:
+  commons-rng-client-api (requires Java 6)
+  commons-rng-core (requires Java 6)
+  commons-rng-simple (requires Java 6)
+  commons-rng-sampling (requires Java 6)
+
+The code in module 'commons-rng-core' should not be accessed
+directly by applications as a future release might make use of
+the JPMS modularization feature available in Java 9+.
+
+Additional code is provided in the following module:
+  commons-rng-examples (requires Java 9)
+It is however not part of the official API and no compatibility
+should be expected in subsequent releases.
+">
+      <action dev="erans" type="update" issue="RNG-50" due-to="Alex D. Herbert">
+	"PoissonSampler": Algorithms for small mean and large mean have
+	been separated into dedicated classes.  Cache precomputation has
+	been disabled as it is only marginally used and is a performance
+	hit for small sampling sets.
+      </action>
+    </release>
+    
     <release version="1.1" date="2018-08-05" description="
 This is a minor release of Apache Commons RNG, containing a
 few new features and performance improvements.


[02/12] commons-rng git commit: Update prospective release date (and other minor changes).

Posted by ch...@apache.org.
Update prospective release date (and other minor changes).


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/919311f5
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/919311f5
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/919311f5

Branch: refs/heads/1.1
Commit: 919311f5b3ed7feb39a02d44f25d87fef654e8f1
Parents: b9089a8
Author: Gilles <er...@apache.org>
Authored: Wed Aug 1 12:06:05 2018 +0200
Committer: Gilles <er...@apache.org>
Committed: Wed Aug 1 12:25:12 2018 +0200

----------------------------------------------------------------------
 src/changes/changes.xml | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/919311f5/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 04b30ba..4419dc7 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -51,7 +51,8 @@ If the output is not quite correct, check for invisible trailing spaces!
   </properties>
   <body>
 
-    <release version="1.1" date="TBD" description="
+
+    <release version="1.1" date="2018-08-05" description="
 This is a minor release of Apache Commons RNG, containing a
 few new features and performance improvements.
 
@@ -62,13 +63,19 @@ Apache Commons RNG 1.1 contains the following library modules:
   commons-rng-sampling (requires Java 6)
 
 The code in module 'commons-rng-core' should not be accessed
-directly by applications as future release might make use of
-the JPMS modularization feature available from Java 9.
+directly by applications as a future release might make use of
+the JPMS modularization feature available in Java 9+.
 
 Additional code is provided in the following module:
   commons-rng-examples (requires Java 9)
 It is however not part of the official API and no compatibility
 should be expected in subsequent releases.
+
+We would like to also note that unit tests in module 'commons-rng-sampling'
+are bound to fail with some probability; this is expected due to the nature
+of random number generation.  The 'maven-surefire-plugin' can be configured
+to re-run tests that fail and pass the build if they succeed (the test will
+be marked as 'flaky' in the report).
 ">
       <action dev="erans" type="add" issue="RNG-37">
         Implementation of the "Ziggurat" algorithm for Gaussian sampling.


[11/12] commons-rng git commit: Allow 1 failure in sampling tests.

Posted by ch...@apache.org.
Allow 1 failure in sampling tests.

Thanks to Rob for finding out about this trick.


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/2a31d876
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/2a31d876
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/2a31d876

Branch: refs/heads/1.1
Commit: 2a31d8764facb77c8a3c301b0613078df8c93d13
Parents: edb3eed
Author: Gilles <er...@apache.org>
Authored: Sat Aug 4 20:40:12 2018 +0200
Committer: Gilles <er...@apache.org>
Committed: Sat Aug 4 20:40:12 2018 +0200

----------------------------------------------------------------------
 commons-rng-sampling/pom.xml | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/2a31d876/commons-rng-sampling/pom.xml
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/pom.xml b/commons-rng-sampling/pom.xml
index 29c6714..66d2f48 100644
--- a/commons-rng-sampling/pom.xml
+++ b/commons-rng-sampling/pom.xml
@@ -66,4 +66,16 @@
     </dependency>
   </dependencies>
 
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.22.0</version>
+        <configuration>
+          <rerunFailingTestsCount>1</rerunFailingTestsCount>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
 </project>


[08/12] commons-rng git commit: Merge branch 'RNG-50__alex'

Posted by ch...@apache.org.
Merge branch 'RNG-50__alex'

Closes #8


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/1bab1832
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/1bab1832
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/1bab1832

Branch: refs/heads/1.1
Commit: 1bab1832dfdac5244264c0b98a91f16b0042dc18
Parents: 919311f 96a380e
Author: Gilles <er...@apache.org>
Authored: Thu Aug 2 14:44:04 2018 +0200
Committer: Gilles <er...@apache.org>
Committed: Thu Aug 2 14:44:04 2018 +0200

----------------------------------------------------------------------
 .../distribution/LargeMeanPoissonSampler.java   | 207 +++++++++++++++++++
 .../sampling/distribution/PoissonSampler.java   | 134 +-----------
 .../distribution/SmallMeanPoissonSampler.java   |  85 ++++++++
 .../distribution/DiscreteSamplersList.java      |  13 +-
 src/changes/changes.xml                         |  27 +++
 5 files changed, 342 insertions(+), 124 deletions(-)
----------------------------------------------------------------------



[12/12] commons-rng git commit: Merge in master

Posted by ch...@apache.org.
Merge in master


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/406a41d3
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/406a41d3
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/406a41d3

Branch: refs/heads/1.1
Commit: 406a41d33cacf63d885958e2a73b1d7dbd8a6abd
Parents: f735468 2a31d87
Author: Rob Tompkins <ch...@gmail.com>
Authored: Mon Aug 6 08:16:21 2018 -0400
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Mon Aug 6 08:16:21 2018 -0400

----------------------------------------------------------------------
 .../distribution/LargeMeanPoissonSampler.java   | 207 +++++++++++++++++++
 .../sampling/distribution/PoissonSampler.java   | 132 +-----------
 .../distribution/SmallMeanPoissonSampler.java   |  85 ++++++++
 .../distribution/DiscreteSamplersList.java      |  13 +-
 src/changes/changes.xml                         |   8 +-
 5 files changed, 321 insertions(+), 124 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/406a41d3/src/changes/changes.xml
----------------------------------------------------------------------
diff --cc src/changes/changes.xml
index 8901f17,262d7f6..8fba90c
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@@ -51,7 -51,29 +51,7 @@@ If the output is not quite correct, che
    </properties>
    <body>
  
 -
 -    <release version="1.2" date="TBD" description="
 -This is a minor release of Apache Commons RNG, containing a
 -few new features and performance improvements.
 -
 -Apache Commons RNG 1.2 contains the following library modules:
 -  commons-rng-client-api (requires Java 6)
 -  commons-rng-core (requires Java 6)
 -  commons-rng-simple (requires Java 6)
 -  commons-rng-sampling (requires Java 6)
 -
 -The code in module 'commons-rng-core' should not be accessed
 -directly by applications as a future release might make use of
 -the JPMS modularization feature available in Java 9+.
 -
 -Additional code is provided in the following module:
 -  commons-rng-examples (requires Java 9)
 -It is however not part of the official API and no compatibility
 -should be expected in subsequent releases.
 -">
 -    </release>
 -
--    <release version="1.1" date="2018-08-05" description="
++    <release version="1.1" date="2018-08-06" description="
  This is a minor release of Apache Commons RNG, containing a
  few new features and performance improvements.