commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [2/3] commons-rng git commit: Add "ZigguratNormalizedGaussianSampler" (benchmark).
Date Fri, 08 Dec 2017 00:28:42 GMT
Add "ZigguratNormalizedGaussianSampler" (benchmark).


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

Branch: refs/heads/master
Commit: 3cec661a4a763ed06d41019051910dd78db6afc9
Parents: 070ff4a
Author: Gilles <erans@apache.org>
Authored: Thu Dec 7 18:06:58 2017 +0100
Committer: Gilles <erans@apache.org>
Committed: Thu Dec 7 18:06:58 2017 +0100

----------------------------------------------------------------------
 .../rng/jmh/distribution/SamplersPerformance.java      | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/3cec661a/commons-rng-jmh/src/main/java/org/apache/commons/rng/jmh/distribution/SamplersPerformance.java
----------------------------------------------------------------------
diff --git a/commons-rng-jmh/src/main/java/org/apache/commons/rng/jmh/distribution/SamplersPerformance.java
b/commons-rng-jmh/src/main/java/org/apache/commons/rng/jmh/distribution/SamplersPerformance.java
index d24664c..ba50f3a 100644
--- a/commons-rng-jmh/src/main/java/org/apache/commons/rng/jmh/distribution/SamplersPerformance.java
+++ b/commons-rng-jmh/src/main/java/org/apache/commons/rng/jmh/distribution/SamplersPerformance.java
@@ -38,6 +38,7 @@ import org.apache.commons.rng.sampling.distribution.DiscreteSampler;
 import org.apache.commons.rng.sampling.distribution.BoxMullerGaussianSampler;
 import org.apache.commons.rng.sampling.distribution.BoxMullerNormalizedGaussianSampler;
 import org.apache.commons.rng.sampling.distribution.MarsagliaNormalizedGaussianSampler;
+import org.apache.commons.rng.sampling.distribution.ZigguratNormalizedGaussianSampler;
 import org.apache.commons.rng.sampling.distribution.AhrensDieterExponentialSampler;
 import org.apache.commons.rng.sampling.distribution.AhrensDieterMarsagliaTsangGammaSampler;
 import org.apache.commons.rng.sampling.distribution.BoxMullerLogNormalSampler;
@@ -159,7 +160,7 @@ public class SamplersPerformance {
      */
     @Benchmark
     public void runMarsagliaNormalizedGaussianSampler(Sources sources,
-                                                                   Blackhole bh) {
+                                                      Blackhole bh) {
         runSample(new MarsagliaNormalizedGaussianSampler(sources.getGenerator()), bh);
     }
 
@@ -168,6 +169,16 @@ public class SamplersPerformance {
      * @param bh Data sink.
      */
     @Benchmark
+    public void runZigguratNormalizedGaussianSampler(Sources sources,
+                                                     Blackhole bh) {
+        runSample(new ZigguratNormalizedGaussianSampler(sources.getGenerator()), bh);
+    }
+
+    /**
+     * @param sources Source of randomness.
+     * @param bh Data sink.
+     */
+    @Benchmark
     public void runAhrensDieterExponentialSampler(Sources sources,
                                                   Blackhole bh) {
         runSample(new AhrensDieterExponentialSampler(sources.getGenerator(), 4.56), bh);


Mime
View raw message