commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [3/6] commons-rng git commit: Increase coverage.
Date Tue, 22 Nov 2016 13:07:04 GMT
Increase coverage.


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

Branch: refs/heads/master
Commit: d669a5af86b8e2224511f4cac340f177c296b81d
Parents: f3675a4
Author: Gilles <erans@apache.org>
Authored: Tue Nov 22 13:18:37 2016 +0100
Committer: Gilles <erans@apache.org>
Committed: Tue Nov 22 13:18:37 2016 +0100

----------------------------------------------------------------------
 .../commons/rng/sampling/distribution/DiscreteSamplersList.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/d669a5af/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 7e48ec3..54ae32d 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
@@ -94,6 +94,11 @@ public class DiscreteSamplersList {
             add(LIST, new org.apache.commons.math3.distribution.ZipfDistribution(numElementsZipf,
exponentZipf),
                 MathArrays.sequence(5, 1, 1),
                 new RejectionInversionZipfSampler(RandomSource.create(RandomSource.WELL_19937_C),
numElementsZipf, exponentZipf));
+            // Zipf (exponent close to 1).
+            final double exponentCloseToOneZipf = 1 - 1e-10;
+            add(LIST, new org.apache.commons.math3.distribution.ZipfDistribution(numElementsZipf,
exponentCloseToOneZipf),
+                MathArrays.sequence(5, 1, 1),
+                new RejectionInversionZipfSampler(RandomSource.create(RandomSource.WELL_19937_C),
numElementsZipf, exponentCloseToOneZipf));
 
             // Poisson ("inverse method").
             final double meanPoisson = 3.21;


Mime
View raw message