commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [7/8] commons-rng git commit: Remove unneeded or deprecated classes.
Date Thu, 11 Jan 2018 11:42:24 GMT
Remove unneeded or deprecated classes.


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

Branch: refs/heads/master
Commit: 4d83aacba2a5aa3fd09b9ed3037202a483a16146
Parents: 7467b1d
Author: Gilles <erans@apache.org>
Authored: Wed Jan 10 18:22:46 2018 +0100
Committer: Gilles <erans@apache.org>
Committed: Wed Jan 10 18:22:46 2018 +0100

----------------------------------------------------------------------
 .../jmh/distribution/SamplersPerformance.java   | 28 +++++++++-----------
 1 file changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/4d83aacb/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 ba50f3a..37ca30a 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
@@ -35,14 +35,12 @@ import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
 import org.apache.commons.rng.sampling.distribution.ContinuousSampler;
 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;
-import org.apache.commons.rng.sampling.distribution.MarsagliaLogNormalSampler;
+import org.apache.commons.rng.sampling.distribution.LogNormalSampler;
 import org.apache.commons.rng.sampling.distribution.ChengBetaSampler;
 import org.apache.commons.rng.sampling.distribution.ContinuousUniformSampler;
 import org.apache.commons.rng.sampling.distribution.DiscreteUniformSampler;
@@ -139,16 +137,6 @@ public class SamplersPerformance {
      * @param bh Data sink.
      */
     @Benchmark
-    public void runBoxMullerGaussianSampler(Sources sources,
-                                            Blackhole bh) {
-        runSample(new BoxMullerGaussianSampler(sources.getGenerator(), 0, 1), bh);
-    }
-
-    /**
-     * @param sources Source of randomness.
-     * @param bh Data sink.
-     */
-    @Benchmark
     public void runBoxMullerNormalizedGaussianSampler(Sources sources,
                                                       Blackhole bh) {
         runSample(new BoxMullerNormalizedGaussianSampler(sources.getGenerator()), bh);
@@ -201,7 +189,7 @@ public class SamplersPerformance {
     @Benchmark
     public void runBoxMullerLogNormalSampler(Sources sources,
                                              Blackhole bh) {
-        runSample(new BoxMullerLogNormalSampler(sources.getGenerator(), 12.3, 4.6), bh);
+        runSample(new LogNormalSampler(new BoxMullerNormalizedGaussianSampler(sources.getGenerator()),
12.3, 4.6), bh);
     }
 
     /**
@@ -211,7 +199,17 @@ public class SamplersPerformance {
     @Benchmark
     public void runMarsagliaLogNormalSampler(Sources sources,
                                              Blackhole bh) {
-        runSample(new MarsagliaLogNormalSampler(sources.getGenerator(), 12.3, 4.6), bh);
+        runSample(new LogNormalSampler(new MarsagliaNormalizedGaussianSampler(sources.getGenerator()),
12.3, 4.6), bh);
+    }
+
+    /**
+     * @param sources Source of randomness.
+     * @param bh Data sink.
+     */
+    @Benchmark
+    public void runZigguratLogNormalSampler(Sources sources,
+                                            Blackhole bh) {
+        runSample(new LogNormalSampler(new ZigguratNormalizedGaussianSampler(sources.getGenerator()),
12.3, 4.6), bh);
     }
 
     /**


Mime
View raw message