commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [1/5] commons-rng git commit: RNG-42: Use faster implementation.
Date Fri, 12 Jan 2018 13:39:51 GMT
Repository: commons-rng
Updated Branches:
  refs/heads/master a51f23f26 -> 01a2c09ce


RNG-42: Use faster implementation.


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

Branch: refs/heads/master
Commit: d1105853ea4bdb5a330b6b697a96900c77f50dff
Parents: a51f23f
Author: Gilles <erans@apache.org>
Authored: Fri Jan 12 12:29:22 2018 +0100
Committer: Gilles <erans@apache.org>
Committed: Fri Jan 12 12:29:22 2018 +0100

----------------------------------------------------------------------
 .../org/apache/commons/rng/sampling/UnitSphereSampler.java    | 7 ++++---
 .../distribution/AhrensDieterMarsagliaTsangGammaSampler.java  | 2 +-
 .../commons/rng/sampling/distribution/PoissonSampler.java     | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/d1105853/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/UnitSphereSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/UnitSphereSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/UnitSphereSampler.java
index 8ade58b..b289025 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/UnitSphereSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/UnitSphereSampler.java
@@ -18,7 +18,8 @@
 package org.apache.commons.rng.sampling;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.sampling.distribution.MarsagliaNormalizedGaussianSampler;
+import org.apache.commons.rng.sampling.distribution.NormalizedGaussianSampler;
+import org.apache.commons.rng.sampling.distribution.ZigguratNormalizedGaussianSampler;
 
 /**
  * Generate vectors <a href="http://mathworld.wolfram.com/SpherePointPicking.html">
@@ -28,7 +29,7 @@ import org.apache.commons.rng.sampling.distribution.MarsagliaNormalizedGaussianS
  */
 public class UnitSphereSampler {
     /** Sampler used for generating the individual components of the vectors. */
-    private final MarsagliaNormalizedGaussianSampler sampler;
+    private final NormalizedGaussianSampler sampler;
     /** Space dimension. */
     private final int dimension;
 
@@ -40,7 +41,7 @@ public class UnitSphereSampler {
     public UnitSphereSampler(int dimension,
                              UniformRandomProvider rng) {
         this.dimension = dimension;
-        sampler = new MarsagliaNormalizedGaussianSampler(rng);
+        sampler = new ZigguratNormalizedGaussianSampler(rng);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/d1105853/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.java
index 7883362..03d7a08 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.java
@@ -60,7 +60,7 @@ public class AhrensDieterMarsagliaTsangGammaSampler
         super(rng);
         this.alpha = alpha;
         this.theta = theta;
-        gaussian = new MarsagliaNormalizedGaussianSampler(rng);
+        gaussian = new ZigguratNormalizedGaussianSampler(rng);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/d1105853/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 50e696e..2e2d46d 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
@@ -64,7 +64,7 @@ public class PoissonSampler
 
         this.mean = mean;
 
-        gaussian = new MarsagliaNormalizedGaussianSampler(rng);
+        gaussian = new ZigguratNormalizedGaussianSampler(rng);
         exponential = new AhrensDieterExponentialSampler(rng, 1);
         factorialLog = mean < PIVOT ?
             null : // Not used.


Mime
View raw message