This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit a71ba4abc2b514ec0d93ab1f808621a0d5bd5ccf
Author: aherbert <aherb...@apache.org>
AuthorDate: Mon Feb 25 13:11:03 2019 +0000

    Document use of null RandomGenerator in the distribution samplers tests.
---
 .../distribution/ContinuousSamplersList.java       | 78 ++++++++++++----------
 .../distribution/DiscreteSamplersList.java         | 44 ++++++------
 2 files changed, 65 insertions(+), 57 deletions(-)

diff --git 
a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
 
b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
index 1cf4313..d94b617 100644
--- 
a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
+++ 
b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/ContinuousSamplersList.java
@@ -33,176 +33,180 @@ public class ContinuousSamplersList {
 
     static {
         try {
-            // The commons-math distributions are not used for sampling so use 
a null random generator
-            org.apache.commons.math3.random.RandomGenerator rng = null;
+            // This test uses reference distributions from commons-math3 to 
compute the expected
+            // PMF. These distributions have a dual functionality to compute 
the PMF and perform
+            // sampling. When no sampling is needed for the created 
distribution, it is advised
+            // to pass null as the random generator via the appropriate 
constructors to avoid the
+            // additional initialisation overhead.
+            org.apache.commons.math3.random.RandomGenerator unusedRng = null;
 
             // List of distributions to test.
 
             // Gaussian ("inverse method").
             final double meanNormal = -123.45;
             final double sigmaNormal = 6.789;
-            add(LIST, new 
org.apache.commons.math3.distribution.NormalDistribution(rng, meanNormal, 
sigmaNormal),
+            add(LIST, new 
org.apache.commons.math3.distribution.NormalDistribution(unusedRng, meanNormal, 
sigmaNormal),
                 RandomSource.create(RandomSource.KISS));
             // Gaussian (DEPRECATED "Box-Muller").
-            add(LIST, new 
org.apache.commons.math3.distribution.NormalDistribution(rng, meanNormal, 
sigmaNormal),
+            add(LIST, new 
org.apache.commons.math3.distribution.NormalDistribution(unusedRng, meanNormal, 
sigmaNormal),
                 new 
BoxMullerGaussianSampler(RandomSource.create(RandomSource.MT), meanNormal, 
sigmaNormal));
             // Gaussian ("Box-Muller").
-            add(LIST, new 
org.apache.commons.math3.distribution.NormalDistribution(rng, meanNormal, 
sigmaNormal),
+            add(LIST, new 
org.apache.commons.math3.distribution.NormalDistribution(unusedRng, meanNormal, 
sigmaNormal),
                 new GaussianSampler(new 
BoxMullerNormalizedGaussianSampler(RandomSource.create(RandomSource.MT)),
                                     meanNormal, sigmaNormal));
             // Gaussian ("Marsaglia").
-            add(LIST, new 
org.apache.commons.math3.distribution.NormalDistribution(rng, meanNormal, 
sigmaNormal),
+            add(LIST, new 
org.apache.commons.math3.distribution.NormalDistribution(unusedRng, meanNormal, 
sigmaNormal),
                 new GaussianSampler(new 
MarsagliaNormalizedGaussianSampler(RandomSource.create(RandomSource.MT)),
                                     meanNormal, sigmaNormal));
             // Gaussian ("Ziggurat").
-            add(LIST, new 
org.apache.commons.math3.distribution.NormalDistribution(rng, meanNormal, 
sigmaNormal),
+            add(LIST, new 
org.apache.commons.math3.distribution.NormalDistribution(unusedRng, meanNormal, 
sigmaNormal),
                 new GaussianSampler(new 
ZigguratNormalizedGaussianSampler(RandomSource.create(RandomSource.MT)),
                                     meanNormal, sigmaNormal));
 
             // Beta ("inverse method").
             final double alphaBeta = 4.3;
             final double betaBeta = 2.1;
-            add(LIST, new 
org.apache.commons.math3.distribution.BetaDistribution(rng, alphaBeta, 
betaBeta),
+            add(LIST, new 
org.apache.commons.math3.distribution.BetaDistribution(unusedRng, alphaBeta, 
betaBeta),
                 RandomSource.create(RandomSource.ISAAC));
             // Beta ("Cheng").
-            add(LIST, new 
org.apache.commons.math3.distribution.BetaDistribution(rng, alphaBeta, 
betaBeta),
+            add(LIST, new 
org.apache.commons.math3.distribution.BetaDistribution(unusedRng, alphaBeta, 
betaBeta),
                 new 
ChengBetaSampler(RandomSource.create(RandomSource.MWC_256), alphaBeta, 
betaBeta));
-            add(LIST, new 
org.apache.commons.math3.distribution.BetaDistribution(rng, betaBeta, 
alphaBeta),
+            add(LIST, new 
org.apache.commons.math3.distribution.BetaDistribution(unusedRng, betaBeta, 
alphaBeta),
                 new 
ChengBetaSampler(RandomSource.create(RandomSource.WELL_19937_A), betaBeta, 
alphaBeta));
             // Beta ("Cheng", alternate algorithm).
             final double alphaBetaAlt = 0.5678;
             final double betaBetaAlt = 0.1234;
-            add(LIST, new 
org.apache.commons.math3.distribution.BetaDistribution(rng, alphaBetaAlt, 
betaBetaAlt),
+            add(LIST, new 
org.apache.commons.math3.distribution.BetaDistribution(unusedRng, alphaBetaAlt, 
betaBetaAlt),
                 new 
ChengBetaSampler(RandomSource.create(RandomSource.WELL_512_A), alphaBetaAlt, 
betaBetaAlt));
-            add(LIST, new 
org.apache.commons.math3.distribution.BetaDistribution(rng, betaBetaAlt, 
alphaBetaAlt),
+            add(LIST, new 
org.apache.commons.math3.distribution.BetaDistribution(unusedRng, betaBetaAlt, 
alphaBetaAlt),
                 new 
ChengBetaSampler(RandomSource.create(RandomSource.WELL_19937_C), betaBetaAlt, 
alphaBetaAlt));
 
             // Cauchy ("inverse method").
             final double medianCauchy = 0.123;
             final double scaleCauchy = 4.5;
-            add(LIST, new 
org.apache.commons.math3.distribution.CauchyDistribution(rng, medianCauchy, 
scaleCauchy),
+            add(LIST, new 
org.apache.commons.math3.distribution.CauchyDistribution(unusedRng, 
medianCauchy, scaleCauchy),
                 RandomSource.create(RandomSource.WELL_19937_C));
 
             // Chi-square ("inverse method").
             final int dofChi2 = 12;
-            add(LIST, new 
org.apache.commons.math3.distribution.ChiSquaredDistribution(rng, dofChi2),
+            add(LIST, new 
org.apache.commons.math3.distribution.ChiSquaredDistribution(unusedRng, 
dofChi2),
                 RandomSource.create(RandomSource.WELL_19937_A));
 
             // Exponential ("inverse method").
             final double meanExp = 3.45;
-            add(LIST, new 
org.apache.commons.math3.distribution.ExponentialDistribution(rng, meanExp),
+            add(LIST, new 
org.apache.commons.math3.distribution.ExponentialDistribution(unusedRng, 
meanExp),
                 RandomSource.create(RandomSource.WELL_44497_A));
             // Exponential.
-            add(LIST, new 
org.apache.commons.math3.distribution.ExponentialDistribution(rng, meanExp),
+            add(LIST, new 
org.apache.commons.math3.distribution.ExponentialDistribution(unusedRng, 
meanExp),
                 new 
AhrensDieterExponentialSampler(RandomSource.create(RandomSource.MT), meanExp));
 
             // F ("inverse method").
             final int numDofF = 4;
             final int denomDofF = 7;
-            add(LIST, new 
org.apache.commons.math3.distribution.FDistribution(rng, numDofF, denomDofF),
+            add(LIST, new 
org.apache.commons.math3.distribution.FDistribution(unusedRng, numDofF, 
denomDofF),
                 RandomSource.create(RandomSource.MT_64));
 
             // Gamma ("inverse method").
             final double thetaGammaSmallerThanOne = 0.1234;
             final double thetaGammaLargerThanOne = 2.345;
             final double alphaGamma = 3.456;
-            add(LIST, new 
org.apache.commons.math3.distribution.GammaDistribution(rng, 
thetaGammaLargerThanOne, alphaGamma),
+            add(LIST, new 
org.apache.commons.math3.distribution.GammaDistribution(unusedRng, 
thetaGammaLargerThanOne, alphaGamma),
                 RandomSource.create(RandomSource.SPLIT_MIX_64));
             // Gamma (theta < 1).
-            add(LIST, new 
org.apache.commons.math3.distribution.GammaDistribution(rng, 
thetaGammaSmallerThanOne, alphaGamma),
+            add(LIST, new 
org.apache.commons.math3.distribution.GammaDistribution(unusedRng, 
thetaGammaSmallerThanOne, alphaGamma),
                 new 
AhrensDieterMarsagliaTsangGammaSampler(RandomSource.create(RandomSource.XOR_SHIFT_1024_S),
                                                            alphaGamma, 
thetaGammaSmallerThanOne));
             // Gamma (theta > 1).
-            add(LIST, new 
org.apache.commons.math3.distribution.GammaDistribution(rng, 
thetaGammaLargerThanOne, alphaGamma),
+            add(LIST, new 
org.apache.commons.math3.distribution.GammaDistribution(unusedRng, 
thetaGammaLargerThanOne, alphaGamma),
                 new 
AhrensDieterMarsagliaTsangGammaSampler(RandomSource.create(RandomSource.WELL_44497_B),
                                                            alphaGamma, 
thetaGammaLargerThanOne));
 
             // Gumbel ("inverse method").
             final double muGumbel = -4.56;
             final double betaGumbel = 0.123;
-            add(LIST, new 
org.apache.commons.math3.distribution.GumbelDistribution(rng, muGumbel, 
betaGumbel),
+            add(LIST, new 
org.apache.commons.math3.distribution.GumbelDistribution(unusedRng, muGumbel, 
betaGumbel),
                 RandomSource.create(RandomSource.WELL_1024_A));
 
             // Laplace ("inverse method").
             final double muLaplace = 12.3;
             final double betaLaplace = 5.6;
-            add(LIST, new 
org.apache.commons.math3.distribution.LaplaceDistribution(rng, muLaplace, 
betaLaplace),
+            add(LIST, new 
org.apache.commons.math3.distribution.LaplaceDistribution(unusedRng, muLaplace, 
betaLaplace),
                 RandomSource.create(RandomSource.MWC_256));
 
             // Levy ("inverse method").
             final double muLevy = -1.098;
             final double cLevy = 0.76;
-            add(LIST, new 
org.apache.commons.math3.distribution.LevyDistribution(rng, muLevy, cLevy),
+            add(LIST, new 
org.apache.commons.math3.distribution.LevyDistribution(unusedRng, muLevy, 
cLevy),
                 RandomSource.create(RandomSource.TWO_CMRES));
 
             // Log normal ("inverse method").
             final double scaleLogNormal = 2.345;
             final double shapeLogNormal = 0.1234;
-            add(LIST, new 
org.apache.commons.math3.distribution.LogNormalDistribution(rng, 
scaleLogNormal, shapeLogNormal),
+            add(LIST, new 
org.apache.commons.math3.distribution.LogNormalDistribution(unusedRng, 
scaleLogNormal, shapeLogNormal),
                 RandomSource.create(RandomSource.KISS));
             // Log-normal (DEPRECATED "Box-Muller").
-            add(LIST, new 
org.apache.commons.math3.distribution.LogNormalDistribution(rng, 
scaleLogNormal, shapeLogNormal),
+            add(LIST, new 
org.apache.commons.math3.distribution.LogNormalDistribution(unusedRng, 
scaleLogNormal, shapeLogNormal),
                 new 
BoxMullerLogNormalSampler(RandomSource.create(RandomSource.XOR_SHIFT_1024_S), 
scaleLogNormal, shapeLogNormal));
             // Log-normal ("Box-Muller").
-            add(LIST, new 
org.apache.commons.math3.distribution.LogNormalDistribution(rng, 
scaleLogNormal, shapeLogNormal),
+            add(LIST, new 
org.apache.commons.math3.distribution.LogNormalDistribution(unusedRng, 
scaleLogNormal, shapeLogNormal),
                 new LogNormalSampler(new 
BoxMullerNormalizedGaussianSampler(RandomSource.create(RandomSource.XOR_SHIFT_1024_S)),
                                      scaleLogNormal, shapeLogNormal));
             // Log-normal ("Marsaglia").
-            add(LIST, new 
org.apache.commons.math3.distribution.LogNormalDistribution(rng, 
scaleLogNormal, shapeLogNormal),
+            add(LIST, new 
org.apache.commons.math3.distribution.LogNormalDistribution(unusedRng, 
scaleLogNormal, shapeLogNormal),
                 new LogNormalSampler(new 
MarsagliaNormalizedGaussianSampler(RandomSource.create(RandomSource.MT_64)),
                                      scaleLogNormal, shapeLogNormal));
             // Log-normal ("Ziggurat").
-            add(LIST, new 
org.apache.commons.math3.distribution.LogNormalDistribution(rng, 
scaleLogNormal, shapeLogNormal),
+            add(LIST, new 
org.apache.commons.math3.distribution.LogNormalDistribution(unusedRng, 
scaleLogNormal, shapeLogNormal),
                 new LogNormalSampler(new 
ZigguratNormalizedGaussianSampler(RandomSource.create(RandomSource.MWC_256)),
                                      scaleLogNormal, shapeLogNormal));
 
             // Logistic ("inverse method").
             final double muLogistic = -123.456;
             final double sLogistic = 7.89;
-            add(LIST, new 
org.apache.commons.math3.distribution.LogisticDistribution(rng, muLogistic, 
sLogistic),
+            add(LIST, new 
org.apache.commons.math3.distribution.LogisticDistribution(unusedRng, 
muLogistic, sLogistic),
                 RandomSource.create(RandomSource.TWO_CMRES_SELECT, null, 2, 
6));
 
             // Nakagami ("inverse method").
             final double muNakagami = 78.9;
             final double omegaNakagami = 23.4;
             final double inverseAbsoluteAccuracyNakagami = 
org.apache.commons.math3.distribution.NakagamiDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY;
-            add(LIST, new 
org.apache.commons.math3.distribution.NakagamiDistribution(rng, muNakagami, 
omegaNakagami, inverseAbsoluteAccuracyNakagami),
+            add(LIST, new 
org.apache.commons.math3.distribution.NakagamiDistribution(unusedRng, 
muNakagami, omegaNakagami, inverseAbsoluteAccuracyNakagami),
                 RandomSource.create(RandomSource.TWO_CMRES_SELECT, null, 5, 
3));
 
             // Pareto ("inverse method").
             final double scalePareto = 23.45;
             final double shapePareto = 0.1234;
-            add(LIST, new 
org.apache.commons.math3.distribution.ParetoDistribution(rng, scalePareto, 
shapePareto),
+            add(LIST, new 
org.apache.commons.math3.distribution.ParetoDistribution(unusedRng, 
scalePareto, shapePareto),
                 RandomSource.create(RandomSource.TWO_CMRES_SELECT, null, 9, 
11));
             // Pareto.
-            add(LIST, new 
org.apache.commons.math3.distribution.ParetoDistribution(rng, scalePareto, 
shapePareto),
+            add(LIST, new 
org.apache.commons.math3.distribution.ParetoDistribution(unusedRng, 
scalePareto, shapePareto),
                 new 
InverseTransformParetoSampler(RandomSource.create(RandomSource.XOR_SHIFT_1024_S),
 scalePareto, shapePareto));
 
             // T ("inverse method").
             final double dofT = 0.76543;
-            add(LIST, new 
org.apache.commons.math3.distribution.TDistribution(rng, dofT),
+            add(LIST, new 
org.apache.commons.math3.distribution.TDistribution(unusedRng, dofT),
                 RandomSource.create(RandomSource.ISAAC));
 
             // Triangular ("inverse method").
             final double aTriangle = -0.76543;
             final double cTriangle = -0.65432;
             final double bTriangle = -0.54321;
-            add(LIST, new 
org.apache.commons.math3.distribution.TriangularDistribution(rng, aTriangle, 
cTriangle, bTriangle),
+            add(LIST, new 
org.apache.commons.math3.distribution.TriangularDistribution(unusedRng, 
aTriangle, cTriangle, bTriangle),
                 RandomSource.create(RandomSource.MT));
 
             // Uniform ("inverse method").
             final double loUniform = -1.098;
             final double hiUniform = 0.76;
-            add(LIST, new 
org.apache.commons.math3.distribution.UniformRealDistribution(rng, loUniform, 
hiUniform),
+            add(LIST, new 
org.apache.commons.math3.distribution.UniformRealDistribution(unusedRng, 
loUniform, hiUniform),
                 RandomSource.create(RandomSource.TWO_CMRES));
             // Uniform.
-            add(LIST, new 
org.apache.commons.math3.distribution.UniformRealDistribution(rng, loUniform, 
hiUniform),
+            add(LIST, new 
org.apache.commons.math3.distribution.UniformRealDistribution(unusedRng, 
loUniform, hiUniform),
                 new 
ContinuousUniformSampler(RandomSource.create(RandomSource.MT_64), loUniform, 
hiUniform));
 
             // Weibull ("inverse method").
             final double alphaWeibull = 678.9;
             final double betaWeibull = 98.76;
-            add(LIST, new 
org.apache.commons.math3.distribution.WeibullDistribution(rng, alphaWeibull, 
betaWeibull),
+            add(LIST, new 
org.apache.commons.math3.distribution.WeibullDistribution(unusedRng, 
alphaWeibull, betaWeibull),
                 RandomSource.create(RandomSource.WELL_44497_B));
         } catch (Exception e) {
             System.err.println("Unexpected exception while creating the list 
of samplers: " + e);
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 b9e1bc0..5ccc99a 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
@@ -35,25 +35,29 @@ public class DiscreteSamplersList {
 
     static {
         try {
-            // The commons-math distributions are not used for sampling so use 
a null random generator
-            org.apache.commons.math3.random.RandomGenerator rng = null;
+            // This test uses reference distributions from commons-math3 to 
compute the expected
+            // PMF. These distributions have a dual functionality to compute 
the PMF and perform
+            // sampling. When no sampling is needed for the created 
distribution, it is advised
+            // to pass null as the random generator via the appropriate 
constructors to avoid the
+            // additional initialisation overhead.
+            org.apache.commons.math3.random.RandomGenerator unusedRng = null;
 
             // List of distributions to test.
 
             // Binomial ("inverse method").
             final int trialsBinomial = 20;
             final double probSuccessBinomial = 0.67;
-            add(LIST, new 
org.apache.commons.math3.distribution.BinomialDistribution(rng, trialsBinomial, 
probSuccessBinomial),
+            add(LIST, new 
org.apache.commons.math3.distribution.BinomialDistribution(unusedRng, 
trialsBinomial, probSuccessBinomial),
                 MathArrays.sequence(8, 9, 1),
                 RandomSource.create(RandomSource.KISS));
 
             // Geometric ("inverse method").
             final double probSuccessGeometric = 0.21;
-            add(LIST, new 
org.apache.commons.math3.distribution.GeometricDistribution(rng, 
probSuccessGeometric),
+            add(LIST, new 
org.apache.commons.math3.distribution.GeometricDistribution(unusedRng, 
probSuccessGeometric),
                 MathArrays.sequence(10, 0, 1),
                 RandomSource.create(RandomSource.ISAAC));
             // Geometric.
-            add(LIST, new 
org.apache.commons.math3.distribution.GeometricDistribution(rng, 
probSuccessGeometric),
+            add(LIST, new 
org.apache.commons.math3.distribution.GeometricDistribution(unusedRng, 
probSuccessGeometric),
                 MathArrays.sequence(10, 0, 1),
                 new 
GeometricSampler(RandomSource.create(RandomSource.XOR_SHIFT_1024_S), 
probSuccessGeometric));
 
@@ -61,48 +65,48 @@ public class DiscreteSamplersList {
             final int popSizeHyper = 34;
             final int numSuccessesHyper = 11;
             final int sampleSizeHyper = 12;
-            add(LIST, new 
org.apache.commons.math3.distribution.HypergeometricDistribution(rng, 
popSizeHyper, numSuccessesHyper, sampleSizeHyper),
+            add(LIST, new 
org.apache.commons.math3.distribution.HypergeometricDistribution(unusedRng, 
popSizeHyper, numSuccessesHyper, sampleSizeHyper),
                 MathArrays.sequence(10, 0, 1),
                 RandomSource.create(RandomSource.MT));
 
             // Pascal ("inverse method").
             final int numSuccessesPascal = 6;
             final double probSuccessPascal = 0.2;
-            add(LIST, new 
org.apache.commons.math3.distribution.PascalDistribution(rng, 
numSuccessesPascal, probSuccessPascal),
+            add(LIST, new 
org.apache.commons.math3.distribution.PascalDistribution(unusedRng, 
numSuccessesPascal, probSuccessPascal),
                 MathArrays.sequence(18, 1, 1),
                 RandomSource.create(RandomSource.TWO_CMRES));
 
             // Uniform ("inverse method").
             final int loUniform = -3;
             final int hiUniform = 4;
-            add(LIST, new 
org.apache.commons.math3.distribution.UniformIntegerDistribution(rng, 
loUniform, hiUniform),
+            add(LIST, new 
org.apache.commons.math3.distribution.UniformIntegerDistribution(unusedRng, 
loUniform, hiUniform),
                 MathArrays.sequence(8, -3, 1),
                 RandomSource.create(RandomSource.SPLIT_MIX_64));
             // Uniform.
-            add(LIST, new 
org.apache.commons.math3.distribution.UniformIntegerDistribution(rng, 
loUniform, hiUniform),
+            add(LIST, new 
org.apache.commons.math3.distribution.UniformIntegerDistribution(unusedRng, 
loUniform, hiUniform),
                 MathArrays.sequence(8, -3, 1),
                 new 
DiscreteUniformSampler(RandomSource.create(RandomSource.MT_64), loUniform, 
hiUniform));
             // Uniform (large range).
             final int halfMax = Integer.MAX_VALUE / 2;
             final int hiLargeUniform = halfMax + 10;
             final int loLargeUniform = -hiLargeUniform;
-            add(LIST, new 
org.apache.commons.math3.distribution.UniformIntegerDistribution(rng, 
loLargeUniform, hiLargeUniform),
+            add(LIST, new 
org.apache.commons.math3.distribution.UniformIntegerDistribution(unusedRng, 
loLargeUniform, hiLargeUniform),
                 MathArrays.sequence(20, -halfMax, halfMax / 10),
                 new 
DiscreteUniformSampler(RandomSource.create(RandomSource.WELL_1024_A), 
loLargeUniform, hiLargeUniform));
 
             // Zipf ("inverse method").
             final int numElementsZipf = 5;
             final double exponentZipf = 2.345;
-            add(LIST, new 
org.apache.commons.math3.distribution.ZipfDistribution(rng, numElementsZipf, 
exponentZipf),
+            add(LIST, new 
org.apache.commons.math3.distribution.ZipfDistribution(unusedRng, 
numElementsZipf, exponentZipf),
                 MathArrays.sequence(5, 1, 1),
                 RandomSource.create(RandomSource.XOR_SHIFT_1024_S));
             // Zipf.
-            add(LIST, new 
org.apache.commons.math3.distribution.ZipfDistribution(rng, numElementsZipf, 
exponentZipf),
+            add(LIST, new 
org.apache.commons.math3.distribution.ZipfDistribution(unusedRng, 
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(rng, numElementsZipf, 
exponentCloseToOneZipf),
+            add(LIST, new 
org.apache.commons.math3.distribution.ZipfDistribution(unusedRng, 
numElementsZipf, exponentCloseToOneZipf),
                 MathArrays.sequence(5, 1, 1),
                 new 
RejectionInversionZipfSampler(RandomSource.create(RandomSource.WELL_19937_C), 
numElementsZipf, exponentCloseToOneZipf));
 
@@ -110,33 +114,33 @@ public class DiscreteSamplersList {
             final double epsilonPoisson = 
org.apache.commons.math3.distribution.PoissonDistribution.DEFAULT_EPSILON;
             final int maxIterationsPoisson = 
org.apache.commons.math3.distribution.PoissonDistribution.DEFAULT_MAX_ITERATIONS;
             final double meanPoisson = 3.21;
-            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(rng, meanPoisson, 
epsilonPoisson, maxIterationsPoisson),
+            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(unusedRng, 
meanPoisson, epsilonPoisson, maxIterationsPoisson),
                 MathArrays.sequence(10, 0, 1),
                 RandomSource.create(RandomSource.MWC_256));
             // Poisson.
-            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(rng, meanPoisson, 
epsilonPoisson, maxIterationsPoisson),
+            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(unusedRng, 
meanPoisson, epsilonPoisson, maxIterationsPoisson),
                 MathArrays.sequence(10, 0, 1),
                 new PoissonSampler(RandomSource.create(RandomSource.KISS), 
meanPoisson));
             // Dedicated small mean poisson sampler
-            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(rng, meanPoisson, 
epsilonPoisson, maxIterationsPoisson),
+            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(unusedRng, 
meanPoisson, epsilonPoisson, maxIterationsPoisson),
                 MathArrays.sequence(10, 0, 1),
                 new 
SmallMeanPoissonSampler(RandomSource.create(RandomSource.KISS), meanPoisson));
             // Poisson (40 < mean < 80).
             final double largeMeanPoisson = 67.89;
-            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(rng, 
largeMeanPoisson, epsilonPoisson, maxIterationsPoisson),
+            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(unusedRng, 
largeMeanPoisson, epsilonPoisson, maxIterationsPoisson),
                 MathArrays.sequence(50, (int) (largeMeanPoisson - 25), 1),
                 new 
PoissonSampler(RandomSource.create(RandomSource.SPLIT_MIX_64), 
largeMeanPoisson));
             // Dedicated large mean poisson sampler
-            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(rng, 
largeMeanPoisson, epsilonPoisson, maxIterationsPoisson),
+            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(unusedRng, 
largeMeanPoisson, epsilonPoisson, maxIterationsPoisson),
                 MathArrays.sequence(50, (int) (largeMeanPoisson - 25), 1),
                 new 
LargeMeanPoissonSampler(RandomSource.create(RandomSource.SPLIT_MIX_64), 
largeMeanPoisson));
             // Poisson (mean >> 40).
             final double veryLargeMeanPoisson = 543.21;
-            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(rng, 
veryLargeMeanPoisson, epsilonPoisson, maxIterationsPoisson),
+            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(unusedRng, 
veryLargeMeanPoisson, epsilonPoisson, maxIterationsPoisson),
                 MathArrays.sequence(100, (int) (veryLargeMeanPoisson - 50), 1),
                 new 
PoissonSampler(RandomSource.create(RandomSource.SPLIT_MIX_64), 
veryLargeMeanPoisson));
             // Dedicated large mean poisson sampler
-            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(rng, 
veryLargeMeanPoisson, epsilonPoisson, maxIterationsPoisson),
+            add(LIST, new 
org.apache.commons.math3.distribution.PoissonDistribution(unusedRng, 
veryLargeMeanPoisson, epsilonPoisson, maxIterationsPoisson),
                 MathArrays.sequence(100, (int) (veryLargeMeanPoisson - 50), 1),
                 new 
LargeMeanPoissonSampler(RandomSource.create(RandomSource.SPLIT_MIX_64), 
veryLargeMeanPoisson));
         } catch (Exception e) {

Reply via email to