You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2021/08/05 16:45:51 UTC

[commons-rng] branch master updated (b28d453 -> 1bc1a54)

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

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


    from b28d453  Add missing forward slash
     new d8e0cc6  Add profile to build the example application
     new a074a16  Add HOWTO.md to show how to run the example application
     new 5166681  Update help and result messages
     new fb46d54  Pass UniformRandomProvider to the integrator
     new 5d8a927  Compute result after the loop
     new b9fc01c  Exclude duplicate files when shading
     new 1ff88dc  Add HOWTO.md to show how to run the example sampling application
     new a857048  Fix description
     new 4b1135a  Use Command.execute
     new 433b551  Add ZigguratSampler.NormalizedGaussian to visual command
     new d835b3b  Add missing samplers to sampling application
     new fc04e8b  Ignore sampling output files
     new ef1f973  Javadoc
     new aee6f0c  Javadoc param order
     new a04c3c9  Allow mean and sd to be an argument
     new 2701f8d  Add HOWTO.md to show how to run the example JPMS application
     new 85f9020  Exclude more files from the shaded JMH jar
     new d7982c0  Add HOWTO.md to show how to run the example JMH application
     new 8d12f3f  Add HOWTO.md to show how to run the example stress application
     new db5ab1c  Update minimum Java version stated in user guide
     new 1bc1a54  Add examples section to user guide

The 21 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore                                         |   1 +
 commons-rng-examples/examples-jmh/HOWTO.md         |  74 +++++++++++++++
 commons-rng-examples/examples-jmh/pom.xml          |   5 +
 commons-rng-examples/examples-jpms/HOWTO.md        |  58 ++++++++++++
 .../rng/examples/jpms/app/DiceGameApplication.java |  10 +-
 .../commons/rng/examples/jpms/lib/DiceGame.java    |   2 +-
 commons-rng-examples/examples-jpms/runApp.sh       |   8 +-
 commons-rng-examples/examples-quadrature/HOWTO.md  |  41 ++++++++
 commons-rng-examples/examples-quadrature/pom.xml   |  49 ++++++++++
 .../commons/rng/examples/quadrature/ComputePi.java |  15 +--
 .../examples/quadrature/MonteCarloIntegration.java |  16 +---
 commons-rng-examples/examples-sampling/HOWTO.md    |  48 ++++++++++
 commons-rng-examples/examples-sampling/pom.xml     |   3 +
 .../sampling/ExamplesSamplingApplication.java      |   6 +-
 .../examples/sampling/ExamplesSamplingCommand.java |   2 +-
 .../ProbabilityDensityApproximationCommand.java    | 103 +++++++++++++++------
 .../UniformSamplingVisualCheckCommand.java         |   4 +-
 commons-rng-examples/examples-stress/HOWTO.md      |  65 +++++++++++++
 commons-rng-examples/examples-stress/pom.xml       |   3 +
 src/site/apt/userguide/rng.apt                     |  35 ++++++-
 src/site/xdoc/userguide/index.xml                  |   8 +-
 21 files changed, 496 insertions(+), 60 deletions(-)
 create mode 100644 commons-rng-examples/examples-jmh/HOWTO.md
 create mode 100644 commons-rng-examples/examples-jpms/HOWTO.md
 create mode 100644 commons-rng-examples/examples-quadrature/HOWTO.md
 create mode 100644 commons-rng-examples/examples-sampling/HOWTO.md
 create mode 100644 commons-rng-examples/examples-stress/HOWTO.md

[commons-rng] 04/21: Pass UniformRandomProvider to the integrator

Posted by ah...@apache.org.
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 fb46d54f9c252b687079f46ae489b4a019945fa9
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 13:39:18 2021 +0100

    Pass UniformRandomProvider to the integrator
---
 .../org/apache/commons/rng/examples/quadrature/ComputePi.java    | 9 +++++----
 .../commons/rng/examples/quadrature/MonteCarloIntegration.java   | 7 +++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java b/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java
index 56eceb2..829895f 100644
--- a/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java
+++ b/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.rng.examples.quadrature;
 
+import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.simple.RandomSource;
 
 /**
@@ -39,10 +40,10 @@ public class ComputePi extends MonteCarloIntegration {
     private static final int DIMENSION = 2;
 
     /**
-     * @param source RNG algorithm.
+     * @param rng RNG.
      */
-    public ComputePi(RandomSource source) {
-        super(source, DIMENSION);
+    public ComputePi(UniformRandomProvider rng) {
+        super(rng, DIMENSION);
     }
 
     /**
@@ -67,7 +68,7 @@ public class ComputePi extends MonteCarloIntegration {
         final long numPoints = Long.parseLong(args[0]);
         final RandomSource randomSource = RandomSource.valueOf(args[1]);
 
-        final ComputePi piApp = new ComputePi(randomSource);
+        final ComputePi piApp = new ComputePi(randomSource.create());
         final double piMC = piApp.compute(numPoints);
 
         //CHECKSTYLE: stop all
diff --git a/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/MonteCarloIntegration.java b/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/MonteCarloIntegration.java
index fe43df7..ff775d3 100644
--- a/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/MonteCarloIntegration.java
+++ b/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/MonteCarloIntegration.java
@@ -18,7 +18,6 @@
 package org.apache.commons.rng.examples.quadrature;
 
 import org.apache.commons.rng.UniformRandomProvider;
-import org.apache.commons.rng.simple.RandomSource;
 
 /**
  * <a href="https://en.wikipedia.org/wiki/Monte_Carlo_integration">Monte-Carlo method</a>
@@ -33,12 +32,12 @@ public abstract class MonteCarloIntegration {
     /**
      * Simulation constructor.
      *
-     * @param source RNG algorithm.
+     * @param rng RNG.
      * @param dimension Integration domain dimension.
      */
-    public MonteCarloIntegration(RandomSource source,
+    public MonteCarloIntegration(UniformRandomProvider rng,
                                  int dimension) {
-        this.rng = source.create();
+        this.rng = rng;
         this.dimension = dimension;
     }
 

[commons-rng] 09/21: Use Command.execute

Posted by ah...@apache.org.
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 4b1135a3a400bf585736ab75d38fd2f2b2fe205c
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 14:31:23 2021 +0100

    Use Command.execute
---
 .../commons/rng/examples/sampling/ExamplesSamplingApplication.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ExamplesSamplingApplication.java b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ExamplesSamplingApplication.java
index 5a8f214..35bdd20 100644
--- a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ExamplesSamplingApplication.java
+++ b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ExamplesSamplingApplication.java
@@ -17,7 +17,6 @@
 package org.apache.commons.rng.examples.sampling;
 
 import picocli.CommandLine;
-import picocli.CommandLine.RunLast;
 
 /**
  * Executes testing utilities for the samplers in the Commons RNG library.
@@ -25,7 +24,8 @@ import picocli.CommandLine.RunLast;
  * <p>Functionality includes:</p>
  *
  * <ul>
- *   <li>Outputting data from a random generator
+ *   <li>Creating a PDF approximation using sample data from a distribution
+ *   <li>Sampling from a small range from a distribution to visually inspect sampling density
  * </ul>
  */
 public final class ExamplesSamplingApplication {
@@ -46,6 +46,6 @@ public final class ExamplesSamplingApplication {
                 .setCaseInsensitiveEnumValuesAllowed(true);
 
         // Parse the command line and invokes the Callable program
-        cmd.parseWithHandler(new RunLast(), args);
+        cmd.execute(args);
     }
 }

[commons-rng] 02/21: Add HOWTO.md to show how to run the example application

Posted by ah...@apache.org.
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 a074a16df3e4949f40e16708447cc9881fa5d3b8
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 13:33:55 2021 +0100

    Add HOWTO.md to show how to run the example application
---
 commons-rng-examples/examples-quadrature/HOWTO.md | 41 +++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/commons-rng-examples/examples-quadrature/HOWTO.md b/commons-rng-examples/examples-quadrature/HOWTO.md
new file mode 100644
index 0000000..f431ab8
--- /dev/null
+++ b/commons-rng-examples/examples-quadrature/HOWTO.md
@@ -0,0 +1,41 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+Apache Commons RNG Examples Quadrature
+======================================
+
+The quadrature test application will output an approximation for &pi; (3.14159...) using
+Monte-Carlo integration. The application generates random points within a unit box and counts
+the number of points within the unit circle. The approximation to &pi; is made using the ratio of
+the points within the circle to the total number of points, which should be &pi;/4.
+
+Build the application using:
+
+        mvn package -P examples-quadrature
+
+Run the application using 2 arguments:
+
+1. The number of random points
+2. The name of the random generator
+
+For example:
+
+        java -jar target/examples-quadrature.jar 1000000 KISS
+
+This will output:
+
+        After generating 2000000 random numbers, the error on |𝛑 - 3.14224| is 6.473464102070281E-4

[commons-rng] 12/21: Ignore sampling output files

Posted by ah...@apache.org.
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 fc04e8bd74af009514a6245230d7db0445e15f59
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 15:14:12 2021 +0100

    Ignore sampling output files
    
    Renamed to have the prefix 'pdf.' to allow easier identification.
---
 .gitignore                                         |  1 +
 commons-rng-examples/examples-sampling/HOWTO.md    |  2 +-
 .../ProbabilityDensityApproximationCommand.java    | 42 +++++++++++-----------
 3 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7b6ac0a..ff21ad1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,4 @@ site-content*
 /.externalToolBuilders/
 /maven-eclipse.xml
 stdin2testu01
+pdf.*.txt
diff --git a/commons-rng-examples/examples-sampling/HOWTO.md b/commons-rng-examples/examples-sampling/HOWTO.md
index dc93690..516f4a0 100644
--- a/commons-rng-examples/examples-sampling/HOWTO.md
+++ b/commons-rng-examples/examples-sampling/HOWTO.md
@@ -36,7 +36,7 @@ the commands:
 The `density` command computes a histogram of the distribution and uses this to create an
 approximation of the probability denssity function for the distribution. The data is recorded to
 a file named using the sampler. For example to output a histogram of a
-`ZigguratGaussianSampler` to the file `gauss.ziggurat.txt` use:
+`ZigguratGaussianSampler` to the file `pdf.gauss.ziggurat.txt` use:
 
         java -jar target/examples-sampling.jar density -s ZigguratGaussianSampler
 
diff --git a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
index 36a46a8..f698e81 100644
--- a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
+++ b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
@@ -125,7 +125,7 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
      * @param max abscissa of the last bin: every sample larger than or
      * equal to that value will increment an additional bin (of infinite
      * width) placed after the last "equal-width" bin.
-     * @param outputFile Filename.
+     * @param outputFile Filename (final name is "pdf.[filename].txt").
      * @throws IOException Signals that an I/O exception has occurred.
      */
     private void createDensity(ContinuousSampler sampler,
@@ -158,7 +158,7 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
         final double binHalfSize = 0.5 * binSize;
         final double norm = 1 / (binSize * numSamples);
 
-        try (PrintWriter out = new PrintWriter(outputFile, "UTF-8")) {
+        try (PrintWriter out = new PrintWriter("pdf." + outputFile + ".txt", "UTF-8")) {
             // CHECKSTYLE: stop MultipleStringLiteralsCheck
             out.println("# Sampler: " + sampler);
             out.println("# Number of bins: " + numBins);
@@ -201,22 +201,22 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
         if (samplers.contains(Sampler.ZigguratGaussianSampler)) {
             createDensity(GaussianSampler.of(ZigguratNormalizedGaussianSampler.of(rng),
                                              gaussMean, gaussSigma),
-                          gaussMin, gaussMax, "gauss.ziggurat.txt");
+                          gaussMin, gaussMax, "gauss.ziggurat");
         }
         if (samplers.contains(Sampler.MarsagliaGaussianSampler)) {
             createDensity(GaussianSampler.of(MarsagliaNormalizedGaussianSampler.of(rng),
                                              gaussMean, gaussSigma),
-                          gaussMin, gaussMax, "gauss.marsaglia.txt");
+                          gaussMin, gaussMax, "gauss.marsaglia");
         }
         if (samplers.contains(Sampler.BoxMullerGaussianSampler)) {
             createDensity(GaussianSampler.of(BoxMullerNormalizedGaussianSampler.of(rng),
                                              gaussMean, gaussSigma),
-                          gaussMin, gaussMax, "gauss.boxmuller.txt");
+                          gaussMin, gaussMax, "gauss.boxmuller");
         }
         if (samplers.contains(Sampler.ModifiedZigguratGaussianSampler)) {
             createDensity(GaussianSampler.of(ZigguratSampler.NormalizedGaussian.of(rng),
                                              gaussMean, gaussSigma),
-                          gaussMin, gaussMax, "gauss.modified.ziggurat.txt");
+                          gaussMin, gaussMax, "gauss.modified.ziggurat");
         }
 
         final double betaMin = 0;
@@ -225,13 +225,13 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
             final double alphaBeta = 4.3;
             final double betaBeta = 2.1;
             createDensity(ChengBetaSampler.of(rng, alphaBeta, betaBeta),
-                          betaMin, betaMax, "beta.case1.txt");
+                          betaMin, betaMax, "beta.case1");
         }
         if (samplers.contains(Sampler.ChengBetaSamplerCase2)) {
             final double alphaBetaAlt = 0.5678;
             final double betaBetaAlt = 0.1234;
             createDensity(ChengBetaSampler.of(rng, alphaBetaAlt, betaBetaAlt),
-                          betaMin, betaMax, "beta.case2.txt");
+                          betaMin, betaMax, "beta.case2");
         }
 
         final double meanExp = 3.45;
@@ -239,11 +239,11 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
         final double expMax = 60;
         if (samplers.contains(Sampler.AhrensDieterExponentialSampler)) {
             createDensity(AhrensDieterExponentialSampler.of(rng, meanExp),
-                          expMin, expMax, "exp.txt");
+                          expMin, expMax, "exp");
         }
         if (samplers.contains(Sampler.ModifiedZigguratExponentialSampler)) {
             createDensity(ZigguratSampler.Exponential.of(rng, meanExp),
-                          expMin, expMax, "exp.modified.ziggurat.txt");
+                          expMin, expMax, "exp.modified.ziggurat");
         }
 
         final double gammaMin = 0;
@@ -252,13 +252,13 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
         if (samplers.contains(Sampler.AhrensDieterMarsagliaTsangGammaSamplerCase1)) {
             final double alphaGammaSmallerThanOne = 0.1234;
             createDensity(AhrensDieterMarsagliaTsangGammaSampler.of(rng, alphaGammaSmallerThanOne, thetaGamma),
-                          gammaMin, gammaMax1, "gamma.case1.txt");
+                          gammaMin, gammaMax1, "gamma.case1");
         }
         if (samplers.contains(Sampler.AhrensDieterMarsagliaTsangGammaSamplerCase2)) {
             final double alphaGammaLargerThanOne = 2.345;
             final double gammaMax2 = 70;
             createDensity(AhrensDieterMarsagliaTsangGammaSampler.of(rng, alphaGammaLargerThanOne, thetaGamma),
-                          gammaMin, gammaMax2, "gamma.case2.txt");
+                          gammaMin, gammaMax2, "gamma.case2");
         }
 
         final double scalePareto = 23.45;
@@ -267,14 +267,14 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
         final double paretoMax = 400;
         if (samplers.contains(Sampler.InverseTransformParetoSampler)) {
             createDensity(InverseTransformParetoSampler.of(rng, scalePareto, shapePareto),
-                          paretoMin, paretoMax, "pareto.txt");
+                          paretoMin, paretoMax, "pareto");
         }
 
         final double loUniform = -9.876;
         final double hiUniform = 5.432;
         if (samplers.contains(Sampler.ContinuousUniformSampler)) {
             createDensity(ContinuousUniformSampler.of(rng, loUniform, hiUniform),
-                          loUniform, hiUniform, "uniform.txt");
+                          loUniform, hiUniform, "uniform");
         }
 
         final double scaleLogNormal = 2.345;
@@ -284,22 +284,22 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
         if (samplers.contains(Sampler.LogNormalZigguratGaussianSampler)) {
             createDensity(LogNormalSampler.of(ZigguratNormalizedGaussianSampler.of(rng),
                                               scaleLogNormal, shapeLogNormal),
-                          logNormalMin, logNormalMax, "lognormal.ziggurat.txt");
+                          logNormalMin, logNormalMax, "lognormal.ziggurat");
         }
         if (samplers.contains(Sampler.LogNormalMarsagliaGaussianSampler)) {
             createDensity(LogNormalSampler.of(MarsagliaNormalizedGaussianSampler.of(rng),
                                               scaleLogNormal, shapeLogNormal),
-                          logNormalMin, logNormalMax, "lognormal.marsaglia.txt");
+                          logNormalMin, logNormalMax, "lognormal.marsaglia");
         }
         if (samplers.contains(Sampler.LogNormalBoxMullerGaussianSampler)) {
             createDensity(LogNormalSampler.of(BoxMullerNormalizedGaussianSampler.of(rng),
                                               scaleLogNormal, shapeLogNormal),
-                          logNormalMin, logNormalMax, "lognormal.boxmuller.txt");
+                          logNormalMin, logNormalMax, "lognormal.boxmuller");
         }
         if (samplers.contains(Sampler.LogNormalModifiedZigguratGaussianSampler)) {
             createDensity(LogNormalSampler.of(ZigguratSampler.NormalizedGaussian.of(rng),
                                               scaleLogNormal, shapeLogNormal),
-                          logNormalMin, logNormalMax, "lognormal.modified.ziggurat.txt");
+                          logNormalMin, logNormalMax, "lognormal.modified.ziggurat");
         }
 
         if (samplers.contains(Sampler.LevySampler)) {
@@ -309,17 +309,17 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
             // Quantile 0.99
             final double levyMax = 4.7756e+03;
             createDensity(LevySampler.of(rng, levyLocation, levyscale),
-                          levyMin, levyMax, "levy.txt");
+                          levyMin, levyMax, "levy");
         }
 
         if (samplers.contains(Sampler.StableSampler)) {
             final double stableAlpha = 1.23;
             final double stableBeta = 0.25;
-            // Quantiles 0.0005 to 0.9995   
+            // Quantiles 0.0005 to 0.9995
             final double stableMin = -131.9640;
             final double stableMax = 200.9239;
             createDensity(StableSampler.of(rng, stableAlpha, stableBeta),
-                          stableMin, stableMax, "stable.txt");
+                          stableMin, stableMax, "stable");
         }
 
         return null;

[commons-rng] 21/21: Add examples section to user guide

Posted by ah...@apache.org.
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 1bc1a541db5a17374866b4945122bfbc4bcc5f49
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 17:45:48 2021 +0100

    Add examples section to user guide
---
 src/site/apt/userguide/rng.apt    | 33 +++++++++++++++++++++++++++++++--
 src/site/xdoc/userguide/index.xml |  8 ++++++--
 2 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/src/site/apt/userguide/rng.apt b/src/site/apt/userguide/rng.apt
index 8626f84..371070e 100644
--- a/src/site/apt/userguide/rng.apt
+++ b/src/site/apt/userguide/rng.apt
@@ -584,7 +584,6 @@ double[] coordinate = sampler.sample();
 
   []
 
-
 4. Performance
 
   This section reports
@@ -973,7 +972,37 @@ double[] coordinate = sampler.sample();
 | <<PCG_RXS_M_XS_64_OS>> | {{{../txt/userguide/stress/dh_47_1}0}}, {{{../txt/userguide/stress/dh_47_2}0}}, {{{../txt/userguide/stress/dh_47_3}0}}, {{{../txt/userguide/stress/dh_47_4}0}}, {{{../txt/userguide/stress/dh_47_5}0}} | {{{../txt/userguide/stress/tu_47_1}0}}, {{{../txt/userguide/stress/tu_47_2}0}}, {{{../txt/userguide/stress/tu_47_3}0}}, {{{../txt/userguide/stress/tu_47_4}1}}, {{{../txt/userguide/stress/tu_47_5}2}} | {{{../txt/userguide/stress/pr_47_1}-}}, {{{../txt/userguide/str [...]
 *-----------------+------------+---------------------+-------------+
 
+6. Examples
+
+  The source distribution for Apache Commons RNG contains example applications to demonstrate
+  functionality of the library. These are contained in the following modules:
+
+*----------*---------------+
+|| Example Module || Description ||
+*----------*---------------+
+| Stress | Application for calling external tools that perform stringent uniformity tests (requires Java 8+). This application is used to generate results in the {{{a5._Quality}Quality}} section. |
+*----------*---------------+
+| Sampling | Application producing output from distribution samplers to create an approximate probability density function (PDF). |
+*----------*---------------+
+| Quadrature | Application for computing numerical quadrature by Monte-Carlo (random) integration. |
+*----------*---------------+
+| JMH | Benchmarks that assess the performance of the generators using the Java Microbenchmark Harness (requires Java 8+). This application is used to generate results in the {{{a4._Performance}Performance}} section. |
+*----------*---------------+
+| JPMS | Example JPMS application using all the JPMS modules of Commons RNG (requires Java 11+). |
+*----------*---------------+
+
+  The examples can be built using profiles in the relevant module. For example to build the
+  JMH benchmarks application and show the help information:
+
+----------------------------
+cd commons-rng-examples/examples-jmh
+mvn package -P examples-jmh
+java -jar target/examples-jmh.jar -h
+----------------------------
+
+  Details of each example module is contained in a <<<HOWTO.md>>> document in the module
+  directory.
 
-6. Dependencies
+7. Dependencies
 
   Apache Commons RNG requires JDK 1.7+ and has no runtime dependencies.
diff --git a/src/site/xdoc/userguide/index.xml b/src/site/xdoc/userguide/index.xml
index dfa417e..b692c8e 100644
--- a/src/site/xdoc/userguide/index.xml
+++ b/src/site/xdoc/userguide/index.xml
@@ -49,8 +49,12 @@
           5. Quality</a>
         </li>
         <li>
-          <a href="rng.html#a6._Dependencies">
-          6. Dependencies</a>
+          <a href="rng.html#a6._Examples">
+          6. Examples</a>
+        </li>
+        <li>
+          <a href="rng.html#a7._Dependencies">
+          7. Dependencies</a>
         </li>
       </ul>
 

[commons-rng] 05/21: Compute result after the loop

Posted by ah...@apache.org.
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 5d8a92731dc1d80354da840375ab7c86a92eeec5
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 13:50:59 2021 +0100

    Compute result after the loop
---
 .../commons/rng/examples/quadrature/MonteCarloIntegration.java   | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/MonteCarloIntegration.java b/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/MonteCarloIntegration.java
index ff775d3..df21688 100644
--- a/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/MonteCarloIntegration.java
+++ b/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/MonteCarloIntegration.java
@@ -48,19 +48,14 @@ public abstract class MonteCarloIntegration {
      * @return the integral.
      */
     public double integrate(long n) {
-        double result = 0;
         long inside = 0;
-        long total = 0;
-        while (total < n) {
+        for (long i = 0; i < n; i++) {
             if (isInside(generateU01())) {
                 ++inside;
             }
-
-            ++total;
-            result = inside / (double) total;
         }
 
-        return result;
+        return inside / (double) n;
     }
 
     /**

[commons-rng] 16/21: Add HOWTO.md to show how to run the example JPMS application

Posted by ah...@apache.org.
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 2701f8d7931a17b4e4323a02435b90a323667a28
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 15:39:46 2021 +0100

    Add HOWTO.md to show how to run the example JPMS application
---
 commons-rng-examples/examples-jpms/HOWTO.md | 58 +++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/commons-rng-examples/examples-jpms/HOWTO.md b/commons-rng-examples/examples-jpms/HOWTO.md
new file mode 100644
index 0000000..5d6e6a4
--- /dev/null
+++ b/commons-rng-examples/examples-jpms/HOWTO.md
@@ -0,0 +1,58 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+Apache Commons RNG Examples JPMS Integration Test
+=================================================
+
+The JPMS integration test uses the Common RNG packages in a JPMS application.
+
+Build the packages using:
+
+    mvn package
+
+To run the JPMS application use the script [runApp.sh](runApp.sh). This has a hard-coded
+value for the version of the packaged jars. Ensure the `RNGVERSION` value is correct.
+
+The application contains a game where players roll a six sided die. Each round
+a player will roll the die a number of times and sum the score. The number of rolls for
+a player in a round is taken from a Gaussian distribution. The game has a configurable
+number of players and rounds. All sampling is done using a named RNG. The application
+thus links together the `client-api`, `core`, `simple` and `sampling` JPMS modules from Commons RNG.
+
+Set the parameters within the `runApp.sh` script and run the application using:
+
+    ./runApp.sh
+
+This will output the results of the dice game:
+
+    --- Game 1 ---
+    Player 3 has 244 points
+    Player 2 has 226 points
+    Player 1 has 219 points
+    Player 4 has 186 points
+    
+    --- Game 2 ---
+    Player 4 has 188 points
+    Player 2 has 180 points
+    Player 3 has 173 points
+    Player 1 has 152 points
+    
+    --- Game 3 ---
+    Player 3 has 235 points
+    Player 1 has 211 points
+    Player 2 has 188 points
+    Player 4 has 164 points

[commons-rng] 03/21: Update help and result messages

Posted by ah...@apache.org.
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 5166681434d487753153678ffc93b0638a5be2c9
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 13:34:53 2021 +0100

    Update help and result messages
---
 .../java/org/apache/commons/rng/examples/quadrature/ComputePi.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java b/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java
index f5e0c19..56eceb2 100644
--- a/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java
+++ b/commons-rng-examples/examples-quadrature/src/main/java/org/apache/commons/rng/examples/quadrature/ComputePi.java
@@ -61,7 +61,7 @@ public class ComputePi extends MonteCarloIntegration {
      */
     public static void main(String[] args) {
         if (args.length != EXPECTED_ARGUMENTS) {
-            throw new IllegalStateException("Missing arguments");
+            throw new IllegalStateException("Require arguments: [points] [RNG name]");
         }
 
         final long numPoints = Long.parseLong(args[0]);
@@ -71,8 +71,8 @@ public class ComputePi extends MonteCarloIntegration {
         final double piMC = piApp.compute(numPoints);
 
         //CHECKSTYLE: stop all
-        System.out.println("After generating " + (DIMENSION * numPoints) +
-                           " random numbers, the error on 𝛑 is " + Math.abs(piMC - Math.PI));
+        System.out.printf("After generating %d random numbers, the error on |𝛑 - %s| is %s%n",
+                          DIMENSION * numPoints, piMC, Math.abs(piMC - Math.PI));
         //CHECKSTYLE: resume all
     }
 

[commons-rng] 18/21: Add HOWTO.md to show how to run the example JMH application

Posted by ah...@apache.org.
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 d7982c07932964483e7ad8515080ffa0da41c5a3
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 16:14:21 2021 +0100

    Add HOWTO.md to show how to run the example JMH application
---
 commons-rng-examples/examples-jmh/HOWTO.md | 74 ++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/commons-rng-examples/examples-jmh/HOWTO.md b/commons-rng-examples/examples-jmh/HOWTO.md
new file mode 100644
index 0000000..fe6e75f
--- /dev/null
+++ b/commons-rng-examples/examples-jmh/HOWTO.md
@@ -0,0 +1,74 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+Apache Commons RNG Examples JMH Benchmark
+=========================================
+
+Code for running benchmarks that assess the performance of the random generators and samplers
+in Commons RNG.
+
+Build the package using:
+
+    mvn package -Pexamples-jmh
+
+The Java Microbenchmark Harness ([JMH](http://openjdk.java.net/projects/code-tools/jmh/))
+is used to run the benchmarks. Options to control the benchmark
+can be detailed using the help flag:
+
+    java -jar target/examples-jmh.jar -h
+
+For example controlling the length of each benchmark, the number of iterations and warm-up
+iterations, or the results format.
+
+Executing the jar with no options will run all benchmarks. This will take a long time.
+The source code is organised into packages that reflect the module structure of Commons RNG.
+Browse the source for `core`, `sampling` and `simple` to see what benchmarks are available.
+Benchmarks can be targeted by using a regular expression naming the benchmark class and optionally
+the method.
+
+By default JMH will output results to the console. To save to file use the `-rff` option and specify
+the format using the `-rf` option.
+
+Examples
+--------
+
+Run a benchmark of the `UniformRandomProvider.nextDouble` method for all random providers saving the
+results to file in JSON format:
+
+    java -jar target/examples-jmh.jar NextDoubleGenerationPerformance -rf json -rff out.json
+
+Run a benchmark of the `UniformRandomProvider.nextInt` method for the named random providers:
+
+    java -jar target/examples-jmh.jar NextIntGen.*nextInt$ -p randomSourceName=MSWS,PCG_MCG_XSH_RS_32
+
+Run a benchmark of the `ContinuousSampler.sample` method for the named sampler using all random providers:
+
+    java -jar target/examples-jmh.jar ContinuousSamplersPerformance.sample -p samplerType=ZigguratNormalizedGaussianSampler
+
+Run a benchmark of `DiscreteUniformSampler.sample` or `UniformRandomProvider.nextInt(int)` for a
+specified number of samples for a given range. As the number of samples increases the use of a
+sampler is preferred over the use of the raw provider due to optimisations allowed during sampler
+construction.
+
+    java -jar target/examples-jmh.jar DiscreteUniformSamplerGenerationPerformance -p samples=1000,10000 -p upperBound=155
+
+Compare the speed of generation of Gaussian samples using the named random provider. The relative
+speed of the two implementations of the ziggurat method can vary significantly across JDK version
+and target platform. The `ZigguratSampler.NormalisedGaussian` is more consistent in performance and
+currently the preferred Gaussian sampler.
+
+    java -jar target/examples-jmh.jar NextGaussianPerformance -p randomSourceName=XO_RO_SHI_RO_128_PP

[commons-rng] 07/21: Add HOWTO.md to show how to run the example sampling application

Posted by ah...@apache.org.
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 1ff88dcd9b02db0daa3c7f6731bbcc68e2799ff5
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 14:22:31 2021 +0100

    Add HOWTO.md to show how to run the example sampling application
---
 commons-rng-examples/examples-sampling/HOWTO.md | 48 +++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/commons-rng-examples/examples-sampling/HOWTO.md b/commons-rng-examples/examples-sampling/HOWTO.md
new file mode 100644
index 0000000..dc93690
--- /dev/null
+++ b/commons-rng-examples/examples-sampling/HOWTO.md
@@ -0,0 +1,48 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+Apache Commons RNG Examples Sampling
+====================================
+
+The sampling test application will compute histograms of the sampling output from distribution
+samplers.
+
+Build the application using:
+
+        mvn package -P examples-sampling
+
+The application contains help information describing the usage. Obtain the help by running the
+application with the `-h` flag to obtain the available commands and to obtain information for
+the commands:
+
+        java -jar target/examples-sampling.jar -h
+        java -jar target/examples-sampling.jar density -h
+        java -jar target/examples-sampling.jar visual -h
+
+The `density` command computes a histogram of the distribution and uses this to create an
+approximation of the probability denssity function for the distribution. The data is recorded to
+a file named using the sampler. For example to output a histogram of a
+`ZigguratGaussianSampler` to the file `gauss.ziggurat.txt` use:
+
+        java -jar target/examples-sampling.jar density -s ZigguratGaussianSampler
+
+The `visual` command computes samples from Gaussian random samplers and outputs the samples
+that fall within a very small range. The lower limit of the range is specified and the number
+of IEEE 754 double values above the lower limit is used to specify the sampled range.
+For example to sample the 1000 double values above 0.1:
+
+        java -jar target/examples-sampling.jar visual -b 1000 -s 10

[commons-rng] 17/21: Exclude more files from the shaded JMH jar

Posted by ah...@apache.org.
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 85f902066a2994d82d418d7a2a96574660a42609
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 15:46:37 2021 +0100

    Exclude more files from the shaded JMH jar
---
 commons-rng-examples/examples-jmh/pom.xml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/commons-rng-examples/examples-jmh/pom.xml b/commons-rng-examples/examples-jmh/pom.xml
index 767c876..472ed84 100644
--- a/commons-rng-examples/examples-jmh/pom.xml
+++ b/commons-rng-examples/examples-jmh/pom.xml
@@ -156,6 +156,8 @@
                         <exclude>META-INF/*.SF</exclude>
                         <exclude>META-INF/*.DSA</exclude>
                         <exclude>META-INF/*.RSA</exclude>
+                        <exclude>META-INF/LICENSE</exclude>
+                        <exclude>META-INF/THIRD-PARTY</exclude>
                         <exclude>META-INF/LICENSE.txt</exclude>
                         <exclude>META-INF/MANIFEST.MF</exclude>
                         <exclude>META-INF/NOTICE.txt</exclude>

[commons-rng] 20/21: Update minimum Java version stated in user guide

Posted by ah...@apache.org.
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 db5ab1c090882a2d6efb20e8c0ab7b1cb93866bf
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 17:04:04 2021 +0100

    Update minimum Java version stated in user guide
---
 src/site/apt/userguide/rng.apt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/site/apt/userguide/rng.apt b/src/site/apt/userguide/rng.apt
index ae39c95..8626f84 100644
--- a/src/site/apt/userguide/rng.apt
+++ b/src/site/apt/userguide/rng.apt
@@ -976,4 +976,4 @@ double[] coordinate = sampler.sample();
 
 6. Dependencies
 
-  Apache Commons RNG requires JDK 1.6+ and has no runtime dependencies.
+  Apache Commons RNG requires JDK 1.7+ and has no runtime dependencies.

[commons-rng] 10/21: Add ZigguratSampler.NormalizedGaussian to visual command

Posted by ah...@apache.org.
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 433b55114cfc352eb639945b2bd9f464be97d038
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 14:34:36 2021 +0100

    Add ZigguratSampler.NormalizedGaussian to visual command
---
 .../rng/examples/sampling/UniformSamplingVisualCheckCommand.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/UniformSamplingVisualCheckCommand.java b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/UniformSamplingVisualCheckCommand.java
index 0e50369..4a6ea6f 100644
--- a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/UniformSamplingVisualCheckCommand.java
+++ b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/UniformSamplingVisualCheckCommand.java
@@ -27,6 +27,7 @@ import picocli.CommandLine.Option;
 import java.util.concurrent.Callable;
 
 import org.apache.commons.rng.sampling.distribution.ZigguratNormalizedGaussianSampler;
+import org.apache.commons.rng.sampling.distribution.ZigguratSampler;
 import org.apache.commons.rng.sampling.distribution.MarsagliaNormalizedGaussianSampler;
 import org.apache.commons.rng.sampling.distribution.BoxMullerNormalizedGaussianSampler;
 import org.apache.commons.rng.sampling.distribution.ContinuousSampler;
@@ -67,6 +68,7 @@ class UniformSamplingVisualCheckCommand implements Callable<Void> {
         ZigguratNormalizedGaussianSampler.of(rng),
         MarsagliaNormalizedGaussianSampler.of(rng),
         BoxMullerNormalizedGaussianSampler.of(rng),
+        ZigguratSampler.NormalizedGaussian.of(rng),
     };
 
     // Allow System.out
@@ -89,7 +91,7 @@ class UniformSamplingVisualCheckCommand implements Callable<Void> {
         }
 
         for (int n = 0; n < numSamples; n++) {
-            System.out.printf("[%d]", n, rng.nextDouble());
+            System.out.printf("[%d]", n);
 
             for (final ContinuousSampler s : samplers) {
                 double r = s.sample();

[commons-rng] 19/21: Add HOWTO.md to show how to run the example stress application

Posted by ah...@apache.org.
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 8d12f3f99b8601ad5a2533f686d89d48d015b5fc
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 16:38:03 2021 +0100

    Add HOWTO.md to show how to run the example stress application
---
 commons-rng-examples/examples-stress/HOWTO.md | 65 +++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/commons-rng-examples/examples-stress/HOWTO.md b/commons-rng-examples/examples-stress/HOWTO.md
new file mode 100644
index 0000000..9edb880
--- /dev/null
+++ b/commons-rng-examples/examples-stress/HOWTO.md
@@ -0,0 +1,65 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+Apache Commons RNG Examples Stress Utilities
+============================================
+
+Application for calling external tools that perform stringent uniformity tests.
+
+Build the package using:
+
+    mvn package -Pexamples-stress
+
+The application contains help information describing the usage. Obtain the help by running the
+application with the `-h` flag to obtain the available commands and to obtain information for
+the commands:
+
+    java -jar target/examples-stress.jar -h
+    java -jar target/examples-stress.jar stress -h
+
+The principle command of the application is the `stress` command. The command will create
+random generators from Commons RNG and pass the raw byte output to a program that will test
+uniformity. The program must be installed separately. Examples of how to run the stress test using
+**Dieharder**, **TestU01** and **PractRand** is described in detail on the
+[stress_test](stress_test.md) page.
+
+Passing byte output to an external program that reads 4 bytes or 8 bytes as 32-bits or 64-bits
+requires knowledge of the endianness of the current runtime platform.
+This is described in detail on the [endianness](endianness.md) page.
+
+The application also provides the `output` command to print output from a named random generator
+in a variety of formats. To create a random file of 16K (2 buffers of 8196 bytes) using the
+`JSF_64` generator:
+
+    java -jar target/examples-stress.jar output JSF_64 -f BINARY -n 2 > target/raw
+
+To output numbers from the `KISS` generator as raw bits, integers and unsigned integers:
+
+    java -jar target/examples-stress.jar output -f BITS -x 0123456789abcdef
+
+Since the seed is provided this output should be reproducible across platforms:
+
+    10011001 11100000 01000011 01101011  2581611371 -1713355925
+    01010110 01011101 00110011 10110010  1448948658  1448948658
+    11101001 10001111 11000110 11000000  3918513856  -376453440
+    10111101 00110111 11110101 11100000  3174561248 -1120406048
+    11100100 10111001 00110011 11111001  3837342713  -457624583
+    01010110 01111110 01000011 01001111  1451115343  1451115343
+    11011011 00000100 00111111 11011011  3674488795  -620478501
+    11010101 11100011 00111011 01101000  3588438888  -706528408
+    11110011 11001001 11100000 10001010  4090093706  -204873590
+    01011111 10000001 10001111 00000100  1602326276  1602326276

[commons-rng] 15/21: Allow mean and sd to be an argument

Posted by ah...@apache.org.
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 a04c3c95aa24c966bd0490f0f68fcf6b5ce9e1b1
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 15:39:14 2021 +0100

    Allow mean and sd to be an argument
---
 .../commons/rng/examples/jpms/app/DiceGameApplication.java     | 10 ++++++++--
 commons-rng-examples/examples-jpms/runApp.sh                   |  8 +++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/commons-rng-examples/examples-jpms/jpms-app/src/main/java/org/apache/commons/rng/examples/jpms/app/DiceGameApplication.java b/commons-rng-examples/examples-jpms/jpms-app/src/main/java/org/apache/commons/rng/examples/jpms/app/DiceGameApplication.java
index 31489eb..58dbfcf 100644
--- a/commons-rng-examples/examples-jpms/jpms-app/src/main/java/org/apache/commons/rng/examples/jpms/app/DiceGameApplication.java
+++ b/commons-rng-examples/examples-jpms/jpms-app/src/main/java/org/apache/commons/rng/examples/jpms/app/DiceGameApplication.java
@@ -38,10 +38,14 @@ public final class DiceGameApplication {
      * @param numPlayers Number of players.
      * @param numRounds Number of rounds per game.
      * @param identifier RNG algorithm identifier.
+     * @param mu Mean rolls per round.
+     * @param sigma Standard deviation of rolls per round.
      */
     private DiceGameApplication(int numPlayers,
                                 int numRounds,
-                                RandomSource identifier) {
+                                RandomSource identifier,
+                                double mu,
+                                double sigma) {
         game = new DiceGame(numPlayers, numRounds,
                             identifier.create(),
                             4.3, 2.1);
@@ -66,7 +70,9 @@ public final class DiceGameApplication {
         final int numGames = Integer.parseInt(args[0]);
         final DiceGameApplication app = new DiceGameApplication(Integer.parseInt(args[1]),
                                                                 Integer.parseInt(args[2]),
-                                                                RandomSource.valueOf(args[3]));
+                                                                RandomSource.valueOf(args[3]),
+                                                                Double.parseDouble(args[4]),
+                                                                Double.parseDouble(args[5]));
 
         app.displayModuleInfo();
 
diff --git a/commons-rng-examples/examples-jpms/runApp.sh b/commons-rng-examples/examples-jpms/runApp.sh
index fdf9230..368899d 100755
--- a/commons-rng-examples/examples-jpms/runApp.sh
+++ b/commons-rng-examples/examples-jpms/runApp.sh
@@ -35,7 +35,13 @@ $TOPDIR/commons-rng-client-api/$TARGETDIR/commons-rng-client-api-$RNGVERSION.jar
 MOD=org.apache.commons.rng.examples.jpms.app/org.apache.commons.rng.examples.jpms.app.DiceGameApplication
 
 # Arguments of the application (see source).
-ARGS="3 4 19 MT"
+GAMES=3
+PLAYERS=4
+ROUNDS=19
+RANDOM_SOURCE=JSF_64
+MU=4.3
+SIGMA=2.1
+ARGS="$GAMES $PLAYERS $ROUNDS $RANDOM_SOURCE $MU $SIGMA"
 
 # Assuming Java 9 (or later).
 java --module-path $MODPATH --module $MOD $ARGS

[commons-rng] 06/21: Exclude duplicate files when shading

Posted by ah...@apache.org.
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 b9fc01c4355f26b91396440cb4863186ea9a96cb
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 13:57:12 2021 +0100

    Exclude duplicate files when shading
---
 commons-rng-examples/examples-jmh/pom.xml        | 3 +++
 commons-rng-examples/examples-quadrature/pom.xml | 3 +++
 commons-rng-examples/examples-sampling/pom.xml   | 3 +++
 commons-rng-examples/examples-stress/pom.xml     | 3 +++
 4 files changed, 12 insertions(+)

diff --git a/commons-rng-examples/examples-jmh/pom.xml b/commons-rng-examples/examples-jmh/pom.xml
index 7e915ec..767c876 100644
--- a/commons-rng-examples/examples-jmh/pom.xml
+++ b/commons-rng-examples/examples-jmh/pom.xml
@@ -156,6 +156,9 @@
                         <exclude>META-INF/*.SF</exclude>
                         <exclude>META-INF/*.DSA</exclude>
                         <exclude>META-INF/*.RSA</exclude>
+                        <exclude>META-INF/LICENSE.txt</exclude>
+                        <exclude>META-INF/MANIFEST.MF</exclude>
+                        <exclude>META-INF/NOTICE.txt</exclude>
                       </excludes>
                     </filter>
                   </filters>
diff --git a/commons-rng-examples/examples-quadrature/pom.xml b/commons-rng-examples/examples-quadrature/pom.xml
index 765c0e5..6cc9cbb 100644
--- a/commons-rng-examples/examples-quadrature/pom.xml
+++ b/commons-rng-examples/examples-quadrature/pom.xml
@@ -87,6 +87,9 @@
                         <exclude>META-INF/*.SF</exclude>
                         <exclude>META-INF/*.DSA</exclude>
                         <exclude>META-INF/*.RSA</exclude>
+                        <exclude>META-INF/LICENSE.txt</exclude>
+                        <exclude>META-INF/MANIFEST.MF</exclude>
+                        <exclude>META-INF/NOTICE.txt</exclude>
                       </excludes>
                     </filter>
                   </filters>
diff --git a/commons-rng-examples/examples-sampling/pom.xml b/commons-rng-examples/examples-sampling/pom.xml
index f15beb2..844a698 100644
--- a/commons-rng-examples/examples-sampling/pom.xml
+++ b/commons-rng-examples/examples-sampling/pom.xml
@@ -94,6 +94,9 @@
                         <exclude>META-INF/*.SF</exclude>
                         <exclude>META-INF/*.DSA</exclude>
                         <exclude>META-INF/*.RSA</exclude>
+                        <exclude>META-INF/LICENSE.txt</exclude>
+                        <exclude>META-INF/MANIFEST.MF</exclude>
+                        <exclude>META-INF/NOTICE.txt</exclude>
                       </excludes>
                     </filter>
                   </filters>
diff --git a/commons-rng-examples/examples-stress/pom.xml b/commons-rng-examples/examples-stress/pom.xml
index db404aa..14d2315 100644
--- a/commons-rng-examples/examples-stress/pom.xml
+++ b/commons-rng-examples/examples-stress/pom.xml
@@ -113,6 +113,9 @@
                         <exclude>META-INF/*.SF</exclude>
                         <exclude>META-INF/*.DSA</exclude>
                         <exclude>META-INF/*.RSA</exclude>
+                        <exclude>META-INF/LICENSE.txt</exclude>
+                        <exclude>META-INF/MANIFEST.MF</exclude>
+                        <exclude>META-INF/NOTICE.txt</exclude>
                       </excludes>
                     </filter>
                   </filters>

[commons-rng] 08/21: Fix description

Posted by ah...@apache.org.
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 a8570487667a8a634a40ee570dbc35aa10739d49
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 14:22:49 2021 +0100

    Fix description
---
 .../apache/commons/rng/examples/sampling/ExamplesSamplingCommand.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ExamplesSamplingCommand.java b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ExamplesSamplingCommand.java
index fa3fafc..113b058 100644
--- a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ExamplesSamplingCommand.java
+++ b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ExamplesSamplingCommand.java
@@ -29,7 +29,7 @@ import java.util.concurrent.Callable;
  * <p>This command is will print the top-level help message.</p>
  */
 @Command(name = "examples-sampling",
-         description = "Apache Commons RNG Examples Stress Utilities.")
+         description = "Apache Commons RNG Examples Sampling Utilities.")
 class ExamplesSamplingCommand implements Callable<Void> {
     /** The command specification. Used to print the usage built by Picocli. */
     @Spec

[commons-rng] 11/21: Add missing samplers to sampling application

Posted by ah...@apache.org.
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 d835b3b8de3c824226c3c982dec632bf18c4609c
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 15:05:23 2021 +0100

    Add missing samplers to sampling application
---
 .../ProbabilityDensityApproximationCommand.java    | 53 ++++++++++++++++++++--
 1 file changed, 50 insertions(+), 3 deletions(-)

diff --git a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
index d66b1f0..36a46a8 100644
--- a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
+++ b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
@@ -29,12 +29,15 @@ import picocli.CommandLine.Mixin;
 import picocli.CommandLine.Option;
 
 import org.apache.commons.rng.sampling.distribution.ZigguratNormalizedGaussianSampler;
+import org.apache.commons.rng.sampling.distribution.ZigguratSampler;
 import org.apache.commons.rng.sampling.distribution.MarsagliaNormalizedGaussianSampler;
+import org.apache.commons.rng.sampling.distribution.StableSampler;
 import org.apache.commons.rng.sampling.distribution.BoxMullerNormalizedGaussianSampler;
 import org.apache.commons.rng.sampling.distribution.ChengBetaSampler;
 import org.apache.commons.rng.sampling.distribution.AhrensDieterExponentialSampler;
 import org.apache.commons.rng.sampling.distribution.AhrensDieterMarsagliaTsangGammaSampler;
 import org.apache.commons.rng.sampling.distribution.InverseTransformParetoSampler;
+import org.apache.commons.rng.sampling.distribution.LevySampler;
 import org.apache.commons.rng.sampling.distribution.LogNormalSampler;
 import org.apache.commons.rng.sampling.distribution.ContinuousUniformSampler;
 import org.apache.commons.rng.sampling.distribution.GaussianSampler;
@@ -82,12 +85,16 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
         MarsagliaGaussianSampler,
         /** The Box muller gaussian sampler. */
         BoxMullerGaussianSampler,
+        /** The modified Ziggurat gaussian sampler. */
+        ModifiedZigguratGaussianSampler,
         /** The Cheng beta sampler case 1. */
         ChengBetaSamplerCase1,
         /** The Cheng beta sampler case 2. */
         ChengBetaSamplerCase2,
         /** The Ahrens dieter exponential sampler. */
         AhrensDieterExponentialSampler,
+        /** The modified Ziggurat exponential sampler. */
+        ModifiedZigguratExponentialSampler,
         /** The Ahrens dieter marsaglia tsang gamma sampler small gamma. */
         AhrensDieterMarsagliaTsangGammaSamplerCase1,
         /** The Ahrens dieter marsaglia tsang gamma sampler large gamma. */
@@ -102,6 +109,12 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
         LogNormalMarsagliaGaussianSampler,
         /** The Log normal box muller gaussian sampler. */
         LogNormalBoxMullerGaussianSampler,
+        /** The Log normal modified ziggurat gaussian sampler. */
+        LogNormalModifiedZigguratGaussianSampler,
+        /** The Levy sampler. */
+        LevySampler,
+        /** The stable sampler. */
+        StableSampler,
     }
 
     /**
@@ -200,6 +213,11 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
                                              gaussMean, gaussSigma),
                           gaussMin, gaussMax, "gauss.boxmuller.txt");
         }
+        if (samplers.contains(Sampler.ModifiedZigguratGaussianSampler)) {
+            createDensity(GaussianSampler.of(ZigguratSampler.NormalizedGaussian.of(rng),
+                                             gaussMean, gaussSigma),
+                          gaussMin, gaussMax, "gauss.modified.ziggurat.txt");
+        }
 
         final double betaMin = 0;
         final double betaMax = 1;
@@ -216,13 +234,17 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
                           betaMin, betaMax, "beta.case2.txt");
         }
 
+        final double meanExp = 3.45;
+        final double expMin = 0;
+        final double expMax = 60;
         if (samplers.contains(Sampler.AhrensDieterExponentialSampler)) {
-            final double meanExp = 3.45;
-            final double expMin = 0;
-            final double expMax = 60;
             createDensity(AhrensDieterExponentialSampler.of(rng, meanExp),
                           expMin, expMax, "exp.txt");
         }
+        if (samplers.contains(Sampler.ModifiedZigguratExponentialSampler)) {
+            createDensity(ZigguratSampler.Exponential.of(rng, meanExp),
+                          expMin, expMax, "exp.modified.ziggurat.txt");
+        }
 
         final double gammaMin = 0;
         final double gammaMax1 = 40;
@@ -274,6 +296,31 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
                                               scaleLogNormal, shapeLogNormal),
                           logNormalMin, logNormalMax, "lognormal.boxmuller.txt");
         }
+        if (samplers.contains(Sampler.LogNormalModifiedZigguratGaussianSampler)) {
+            createDensity(LogNormalSampler.of(ZigguratSampler.NormalizedGaussian.of(rng),
+                                              scaleLogNormal, shapeLogNormal),
+                          logNormalMin, logNormalMax, "lognormal.modified.ziggurat.txt");
+        }
+
+        if (samplers.contains(Sampler.LevySampler)) {
+            final double levyLocation = 1.23;
+            final double levyscale = 0.75;
+            final double levyMin = levyLocation;
+            // Quantile 0.99
+            final double levyMax = 4.7756e+03;
+            createDensity(LevySampler.of(rng, levyLocation, levyscale),
+                          levyMin, levyMax, "levy.txt");
+        }
+
+        if (samplers.contains(Sampler.StableSampler)) {
+            final double stableAlpha = 1.23;
+            final double stableBeta = 0.25;
+            // Quantiles 0.0005 to 0.9995   
+            final double stableMin = -131.9640;
+            final double stableMax = 200.9239;
+            createDensity(StableSampler.of(rng, stableAlpha, stableBeta),
+                          stableMin, stableMax, "stable.txt");
+        }
 
         return null;
     }

[commons-rng] 01/21: Add profile to build the example application

Posted by ah...@apache.org.
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 d8e0cc64dbf385a64228c53453227f04fa2f1c56
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 13:19:30 2021 +0100

    Add profile to build the example application
---
 commons-rng-examples/examples-quadrature/pom.xml | 46 ++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/commons-rng-examples/examples-quadrature/pom.xml b/commons-rng-examples/examples-quadrature/pom.xml
index e2a7aea..765c0e5 100644
--- a/commons-rng-examples/examples-quadrature/pom.xml
+++ b/commons-rng-examples/examples-quadrature/pom.xml
@@ -39,6 +39,9 @@
     <commons.automatic.module.name>org.apache.commons.rng.examples.quadrature</commons.automatic.module.name>
     <!-- Workaround to avoid duplicating config files. -->
     <rng.parent.dir>${basedir}/../..</rng.parent.dir>
+
+    <uberjar.name>examples-quadrature</uberjar.name>
+    <project.mainClass>org.apache.commons.rng.examples.quadrature.ComputePi</project.mainClass>
   </properties>
 
   <dependencies>
@@ -53,4 +56,47 @@
     </dependency>
   </dependencies>
 
+  <profiles>
+    <profile>
+      <id>examples-quadrature</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-shade-plugin</artifactId>
+            <version>${rng.shade.version}</version>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <goals>
+                  <goal>shade</goal>
+                </goals>
+                <configuration>
+                  <finalName>${uberjar.name}</finalName>
+                  <minimizeJar>true</minimizeJar>
+                  <transformers>
+                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                      <mainClass>${project.mainClass}</mainClass>
+                    </transformer>
+                  </transformers>
+                  <filters>
+                    <filter>
+                      <!-- Shading signed JARs will fail without this. http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar -->
+                      <artifact>*:*</artifact>
+                      <excludes>
+                        <exclude>META-INF/*.SF</exclude>
+                        <exclude>META-INF/*.DSA</exclude>
+                        <exclude>META-INF/*.RSA</exclude>
+                      </excludes>
+                    </filter>
+                  </filters>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>

[commons-rng] 14/21: Javadoc param order

Posted by ah...@apache.org.
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 aee6f0ce9b715ce2626143cac78fb798ede6c095
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 15:30:03 2021 +0100

    Javadoc param order
---
 .../main/java/org/apache/commons/rng/examples/jpms/lib/DiceGame.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-rng-examples/examples-jpms/jpms-lib/src/main/java/org/apache/commons/rng/examples/jpms/lib/DiceGame.java b/commons-rng-examples/examples-jpms/jpms-lib/src/main/java/org/apache/commons/rng/examples/jpms/lib/DiceGame.java
index 578b2d2..f4d4f20 100644
--- a/commons-rng-examples/examples-jpms/jpms-lib/src/main/java/org/apache/commons/rng/examples/jpms/lib/DiceGame.java
+++ b/commons-rng-examples/examples-jpms/jpms-lib/src/main/java/org/apache/commons/rng/examples/jpms/lib/DiceGame.java
@@ -38,9 +38,9 @@ public class DiceGame {
     /**
      * @param players Number of players.
      * @param rounds Number of rounds.
+     * @param rng RNG.
      * @param mu Mean.
      * @param sigma Standard deviation.
-     * @param rng RNG.
      */
     public DiceGame(int players,
                     int rounds,

[commons-rng] 13/21: Javadoc

Posted by ah...@apache.org.
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 ef1f973f0943758ceb34e58877948f48a329b86f
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Thu Aug 5 15:15:36 2021 +0100

    Javadoc
---
 .../ProbabilityDensityApproximationCommand.java    | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
index f698e81..9dc6086 100644
--- a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
+++ b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
@@ -79,37 +79,37 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
      * The sampler. This enum uses lower case for clarity when matching the distribution name.
      */
     enum Sampler {
-        /** The Ziggurat gaussian sampler. */
+        /** The ziggurat gaussian sampler. */
         ZigguratGaussianSampler,
         /** The Marsaglia gaussian sampler. */
         MarsagliaGaussianSampler,
-        /** The Box muller gaussian sampler. */
+        /** The Box Muller gaussian sampler. */
         BoxMullerGaussianSampler,
-        /** The modified Ziggurat gaussian sampler. */
+        /** The modified ziggurat gaussian sampler. */
         ModifiedZigguratGaussianSampler,
         /** The Cheng beta sampler case 1. */
         ChengBetaSamplerCase1,
         /** The Cheng beta sampler case 2. */
         ChengBetaSamplerCase2,
-        /** The Ahrens dieter exponential sampler. */
+        /** The Ahrens Dieter exponential sampler. */
         AhrensDieterExponentialSampler,
-        /** The modified Ziggurat exponential sampler. */
+        /** The modified ziggurat exponential sampler. */
         ModifiedZigguratExponentialSampler,
-        /** The Ahrens dieter marsaglia tsang gamma sampler small gamma. */
+        /** The Ahrens Dieter Marsaglia Tsang gamma sampler small gamma. */
         AhrensDieterMarsagliaTsangGammaSamplerCase1,
-        /** The Ahrens dieter marsaglia tsang gamma sampler large gamma. */
+        /** The Ahrens Dieter Marsaglia Tsang gamma sampler large gamma. */
         AhrensDieterMarsagliaTsangGammaSamplerCase2,
-        /** The Inverse transform pareto sampler. */
+        /** The inverse transform pareto sampler. */
         InverseTransformParetoSampler,
-        /** The Continuous uniform sampler. */
+        /** The continuous uniform sampler. */
         ContinuousUniformSampler,
-        /** The Log normal ziggurat gaussian sampler. */
+        /** The log normal ziggurat gaussian sampler. */
         LogNormalZigguratGaussianSampler,
-        /** The Log normal marsaglia gaussian sampler. */
+        /** The log normal Marsaglia gaussian sampler. */
         LogNormalMarsagliaGaussianSampler,
-        /** The Log normal box muller gaussian sampler. */
+        /** The log normal Box Muller gaussian sampler. */
         LogNormalBoxMullerGaussianSampler,
-        /** The Log normal modified ziggurat gaussian sampler. */
+        /** The log normal modified ziggurat gaussian sampler. */
         LogNormalModifiedZigguratGaussianSampler,
         /** The Levy sampler. */
         LevySampler,