commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [06/14] commons-rng git commit: RNG-35: Use "BoxMullerNormalizedGaussianSampler" as building block for other samplers.
Date Thu, 09 Feb 2017 00:22:15 GMT
RNG-35: Use "BoxMullerNormalizedGaussianSampler" as building block for other samplers.


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

Branch: refs/heads/master
Commit: 94f084324a99f4f84464ad3b5574a84adc1028e9
Parents: 3b4b798
Author: Gilles <erans@apache.org>
Authored: Tue Jan 24 00:20:07 2017 +0100
Committer: Gilles <erans@apache.org>
Committed: Tue Jan 24 00:20:07 2017 +0100

----------------------------------------------------------------------
 .../distribution/AhrensDieterMarsagliaTsangGammaSampler.java     | 4 ++--
 .../rng/sampling/distribution/BoxMullerLogNormalSampler.java     | 4 ++--
 .../apache/commons/rng/sampling/distribution/PoissonSampler.java | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/94f08432/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 ef5243a..180b531 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
@@ -47,7 +47,7 @@ public class AhrensDieterMarsagliaTsangGammaSampler
     /** The alpha parameter. */
     private final double alpha;
     /** Gaussian sampling. */
-    private final BoxMullerGaussianSampler gaussian;
+    private final NormalizedGaussianSampler gaussian;
 
     /**
      * @param rng Generator of uniformly distributed random numbers.
@@ -60,7 +60,7 @@ public class AhrensDieterMarsagliaTsangGammaSampler
         super(rng);
         this.alpha = alpha;
         this.theta = theta;
-        gaussian = new BoxMullerGaussianSampler(rng, 0, 1);
+        gaussian = new BoxMullerNormalizedGaussianSampler(rng);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/94f08432/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSampler.java
----------------------------------------------------------------------
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSampler.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSampler.java
index f43a9e5..354b8d4 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/BoxMullerLogNormalSampler.java
@@ -30,7 +30,7 @@ public class BoxMullerLogNormalSampler
     /** Shape. */
     private final double shape;
     /** Gaussian sampling. */
-    private final BoxMullerGaussianSampler gaussian;
+    private final NormalizedGaussianSampler gaussian;
 
     /**
      * @param rng Generator of uniformly distributed random numbers.
@@ -43,7 +43,7 @@ public class BoxMullerLogNormalSampler
         super(null); // Not used.
         this.scale = scale;
         this.shape = shape;
-        gaussian = new BoxMullerGaussianSampler(rng, 0, 1);
+        gaussian = new BoxMullerNormalizedGaussianSampler(rng);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/94f08432/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 f189a92..d872be9 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
@@ -46,7 +46,7 @@ public class PoissonSampler
     /** Exponential. */
     private final ContinuousSampler exponential;
     /** Gaussian. */
-    private final ContinuousSampler gaussian;
+    private final NormalizedGaussianSampler gaussian;
     /** {@code log(n!)}. */
     private final InternalUtils.FactorialLog factorialLog;
 
@@ -64,7 +64,7 @@ public class PoissonSampler
 
         this.mean = mean;
 
-        gaussian = new BoxMullerGaussianSampler(rng, 0, 1);
+        gaussian = new BoxMullerNormalizedGaussianSampler(rng);
         exponential = new AhrensDieterExponentialSampler(rng, 1);
         factorialLog = mean < PIVOT ?
             null : // Not used.


Mime
View raw message