(commons-numbers) branch master updated: Update to RNG 1.6
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-numbers.git The following commit(s) were added to refs/heads/master by this push: new 7a3c664d Update to RNG 1.6 7a3c664d is described below commit 7a3c664d0da182a1d35228c0276c6a45d064caaf Author: Alex Herbert AuthorDate: Tue Jul 16 19:15:12 2024 +0100 Update to RNG 1.6 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fc7c8be7..ef6544d2 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ -Xdoclint:all -1.6-SNAPSHOT +1.6 3.6.1
(commons-statistics) branch master updated: Update to RNG 1.6
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-statistics.git The following commit(s) were added to refs/heads/master by this push: new 5439ec7 Update to RNG 1.6 5439ec7 is described below commit 5439ec7e9c8069d6cc8ce6c3ed4af013a06218ff Author: Alex Herbert AuthorDate: Tue Jul 16 19:14:32 2024 +0100 Update to RNG 1.6 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3232dae..3a62f85 100644 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ -Xdoclint:all - 1.6-SNAPSHOT +1.6 1.2-SNAPSHOT 3.6.1 4.0-beta1
(commons-rng) branch master updated: Add note on the build timestamp
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 The following commit(s) were added to refs/heads/master by this push: new 3baa1804 Add note on the build timestamp 3baa1804 is described below commit 3baa1804edc94837977e2d9aa5a8e1d2e6c8cbb8 Author: Alex Herbert AuthorDate: Mon Jul 15 13:14:48 2024 +0100 Add note on the build timestamp --- doc/release/release.howto.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/release/release.howto.txt b/doc/release/release.howto.txt index 14fe6f8e..7e1a6e2b 100644 --- a/doc/release/release.howto.txt +++ b/doc/release/release.howto.txt @@ -1000,10 +1000,13 @@ next version will be 1.7). the dependencies. This should be updated manually. Double-check that the "pom.xml" files *really* have a "-SNAPSHOT" suffix in the "" property. + Also check the correctly references + rng.build.outputTimestamp (changes will have to be reverted): $ git grep '1.6-SNAPSHOT'[old version number] $ git grep '1.7-SNAPSHOT'[new version number] $ git grep '' + $ git grep 'project.build.outputTimestamp' Then commit them.
(commons-rng) branch master updated: Remove trailing whitespace
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 The following commit(s) were added to refs/heads/master by this push: new 8a8fb66f Remove trailing whitespace 8a8fb66f is described below commit 8a8fb66fb5633347ff4abb223500f94f718f0569 Author: Alex Herbert AuthorDate: Mon Jul 15 13:03:47 2024 +0100 Remove trailing whitespace --- .../src/test/java/org/apache/commons/rng/sampling/RandomAssert.java | 2 +- src/site/site.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java index f43d23bd..a6e9a3b1 100644 --- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java +++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java @@ -239,7 +239,7 @@ public final class RandomAssert { * It should be noted that repeat invocations of a failing test by the surefire plugin * will receive an instance with the same seed. If a test may fail due to stochastic conditions * then consider using {@link RandomAssert#createRNG()} or {@link #createRNG(int)} which will - * obtain a different RNG for repeat test executions. + * obtain a different RNG for repeat test executions. * * @return the uniform random provider * @see RandomSource#create() diff --git a/src/site/site.xml b/src/site/site.xml index a5e053c7..3cdfecf6 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -56,7 +56,7 @@ -
(commons-rng) branch master updated (390021b4 -> f1a6ed79)
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 390021b4 Revert "Update the fail/report criticality for revapi" new b19aed99 Update transformed sampler test to allow better failure identification new 013b1e2f Javadoc test helper methods new 51a17f6a Update following 1.6 release new 808571bd Update for next development version new 9ed328b5 Update README pages following 1.6 release new f5e60d6f Bump versions for next development cycle new f1a6ed79 Update release notes The 7 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: README.md | 43 ++- RELEASE-NOTES.txt | 62 commons-rng-bom/README.md | 28 +- commons-rng-bom/pom.xml| 5 +- commons-rng-bom/src/site/xdoc/index.xml| 2 +- commons-rng-client-api/README.md | 43 ++- commons-rng-client-api/pom.xml | 4 +- commons-rng-client-api/src/site/site.xml | 2 + commons-rng-core/README.md | 43 ++- commons-rng-core/pom.xml | 6 +- commons-rng-core/src/site/site.xml | 2 + .../README.md | 48 +-- commons-rng-docs/pom.xml | 10 +- commons-rng-examples/README.md | 47 +-- commons-rng-examples/examples-jmh/README.md| 50 ++-- commons-rng-examples/examples-jmh/pom.xml | 5 +- commons-rng-examples/examples-jpms/README.md | 49 ++-- .../examples-jpms/jpms-app/README.md | 50 ++-- .../examples-jpms/jpms-app/pom.xml | 6 +- .../examples-jpms/jpms-lib/README.md | 51 ++-- .../examples-jpms/jpms-lib/pom.xml | 4 +- commons-rng-examples/examples-jpms/pom.xml | 4 +- commons-rng-examples/examples-jpms/runApp.sh | 2 +- commons-rng-examples/examples-quadrature/README.md | 50 ++-- commons-rng-examples/examples-quadrature/pom.xml | 4 +- commons-rng-examples/examples-sampling/README.md | 50 ++-- commons-rng-examples/examples-sampling/pom.xml | 4 +- commons-rng-examples/examples-stress/README.md | 50 ++-- commons-rng-examples/examples-stress/pom.xml | 4 +- commons-rng-examples/pom.xml | 10 +- commons-rng-integration/README.md | 45 +-- commons-rng-integration/pom.xml| 8 +- .../apache/commons/rng/integration/tests.bndrun| 10 +- commons-rng-sampling/README.md | 43 ++- commons-rng-sampling/pom.xml | 8 +- commons-rng-sampling/src/site/site.xml | 2 + .../apache/commons/rng/sampling/RandomAssert.java | 6 +- .../sampling/distribution/StableSamplerTest.java | 73 +++-- commons-rng-simple/README.md | 43 ++- commons-rng-simple/pom.xml | 8 +- commons-rng-simple/src/site/site.xml | 2 + dist-archive/pom.xml | 28 +- doc/release/release.howto.txt | 325 - pom.xml| 8 +- src/changes/changes.xml| 7 +- .../resources/release-notes/RELEASE-NOTES-1.6.txt | 62 src/site/xdoc/download_rng.xml | 28 +- 47 files changed, 767 insertions(+), 677 deletions(-) copy {commons-rng-integration => commons-rng-docs}/README.md (68%) copy RELEASE-NOTES.txt => src/site/resources/release-notes/RELEASE-NOTES-1.6.txt (91%)
(commons-rng) 05/07: Update README pages following 1.6 release
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 9ed328b57e4c309559d52a6c4aaa8069db7de87a Author: Alex Herbert AuthorDate: Mon Jul 15 12:35:56 2024 +0100 Update README pages following 1.6 release --- README.md | 43 +++--- commons-rng-bom/README.md | 28 ++-- commons-rng-client-api/README.md | 43 +++--- commons-rng-core/README.md | 43 +++--- .../README.md | 48 +++- commons-rng-examples/README.md | 47 +++- commons-rng-examples/examples-jmh/README.md| 50 - commons-rng-examples/examples-jpms/README.md | 49 - .../examples-jpms/jpms-app/README.md | 50 - .../examples-jpms/jpms-lib/README.md | 51 -- commons-rng-examples/examples-quadrature/README.md | 50 - commons-rng-examples/examples-sampling/README.md | 50 - commons-rng-examples/examples-stress/README.md | 50 - commons-rng-integration/README.md | 45 +++ commons-rng-sampling/README.md | 43 +++--- commons-rng-simple/README.md | 43 +++--- 16 files changed, 317 insertions(+), 416 deletions(-) diff --git a/README.md b/README.md index 88ec7c32..00942fbb 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ | 3) Example Properties| | | | | - |rng| + |math | |1.2| | | | | @@ -43,11 +43,11 @@ Apache Commons RNG === -[![Build Status](https://github.com/apache/commons-rng/actions/workflows/maven.yml/badge.svg)](https://github.com/apache/commons-rng/actions/workflows/maven.yml) +[![Java CI](https://github.com/apache/commons-rng/actions/workflows/maven.yml/badge.svg)](https://github.com/apache/commons-rng/actions/workflows/maven.yml) [![Coverage Status](https://codecov.io/gh/apache/commons-rng/branch/master/graph/badge.svg)](https://app.codecov.io/gh/apache/commons-rng) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=commons-rng=alert_status)](https://sonarcloud.io/dashboard?id=commons-rng) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-rng-simple/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-rng-simple/) -[![Javadocs](https://javadoc.io/badge/org.apache.commons/commons-rng-simple/1.5.svg)](https://javadoc.io/doc/org.apache.commons/commons-rng-simple/1.5) +[![Javadocs](https://javadoc.io/badge/org.apache.commons/commons-rng-simple/1.6.svg)](https://javadoc.io/doc/org.apache.commons/commons-rng-simple/1.6) The Apache Commons RNG project provides pure-Java implementation of pseudo-random generators. @@ -63,32 +63,40 @@ More information can be found on the [Apache Commons RNG homepage](https://commo Questions related to the usage of Apache Commons RNG should be posted to the [user mailing list](https://commons.apache.org/mail-lists.html). -Where can I get the latest release? +Getting the latest release +-- You can download source and binaries from our [download page](https://commons.apache.org/proper/commons-rng/download_rng.cgi). -Alternatively, you can pull it from the central Maven repositories, e.g.: +Alternatively, you can pull it from the central Maven repositories: ```xml org.apache.commons commons-rng-simple - 1.5 + 1.6 org.apache.commons commons-rng-sampling - 1.5 + 1.6 ``` +Building + + +Building requires a Java JDK and [Apache Maven](https://maven.apache.org/). +The required Java version is found in the `pom.xml` as the `maven.compiler.source` property. + +From a command shell, run `mvn` without arguments to invoke the default Maven goal to run all tests and checks. + Contributing -We accept Pull Requests via GitHub. The [developer mailing list][ml] is the main channel of communication for contributors. +We accept Pull Requests via GitHub. The [developer mailing list](https://commons.apache.org/mail-lists.html) is the main channel of communication for contributors. There are some guidelines which will make applying PRs easier for us
(commons-rng) 01/07: Update transformed sampler test to allow better failure identification
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 b19aed99d88aa7cc6bcd5f7c63063bdbae66f65e Author: Alex Herbert AuthorDate: Tue Jul 9 15:31:40 2024 +0100 Update transformed sampler test to allow better failure identification Change tolerance from 1 ulp to 2 ulp. Addresses test failures observed during release of version 1.6. --- .../sampling/distribution/StableSamplerTest.java | 73 ++ 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java index cf32008b..86cd9d97 100644 --- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java +++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/StableSamplerTest.java @@ -17,6 +17,7 @@ package org.apache.commons.rng.sampling.distribution; import java.util.function.Supplier; +import java.util.stream.Stream; import org.apache.commons.rng.UniformRandomProvider; import org.apache.commons.rng.core.source64.SplitMix64; import org.apache.commons.rng.sampling.RandomAssert; @@ -28,6 +29,9 @@ import org.apache.commons.rng.sampling.distribution.StableSampler.WeronStableSam import org.apache.commons.rng.simple.RandomSource; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; /** * Tests for the class {@link StableSampler}. @@ -2044,44 +2048,30 @@ class StableSamplerTest { RandomAssert.assertProduceSameSequence(sampler1, sampler2); } -/** - * Test the implementation of the transformed sampler (scaled and translated). - */ -@Test -void testTransformedSampler() { -// Gaussian case -// The Gaussian case has its own scaling where the StdDev is gamma * sqrt(2). -// (N(x) * sqrt(2)) * gamma != N(x) * (sqrt(2) * gamma) -// Test with a delta -testTransformedSampler(2.0, 0.0, 1); -// Cauchy case -testTransformedSampler(1.0, 0.0); -// Levy case -testTransformedSampler(0.5, 1.0); -// Symmetric case -testTransformedSampler(1.3, 0.0); -// Alpha 1 case -testTransformedSampler(1.0, 0.23); -// Alpha close to 1 -testTransformedSampler(Math.nextUp(1.0), 0.23); -// General case -testTransformedSampler(1.3, 0.1); -// Small alpha case -testTransformedSampler(1e-5, 0.1); -// Large alpha case. -// This hits the case for computing tau from (1-alpha) -> -1. -testTransformedSampler(1.99, 0.1); -} - -/** - * Test the implementation of the transformed sampler (scaled and translated). - * The transformed output must match exactly. - * - * @param alpha Alpha. - * @param beta Beta. - */ -private static void testTransformedSampler(double alpha, double beta) { -testTransformedSampler(alpha, beta, 0); +static Stream testTransformedSampler() { +return Stream.of( +// Gaussian case +// The Gaussian case has its own scaling where the StdDev is gamma * sqrt(2). +// (N(x) * sqrt(2)) * gamma != N(x) * (sqrt(2) * gamma) +// Test with a delta +Arguments.of(2.0, 0.0, 2), +// Cauchy case +Arguments.of(1.0, 0.0, 0), +// Levy case +Arguments.of(0.5, 1.0, 0), +// Symmetric case +Arguments.of(1.3, 0.0, 0), +// Alpha 1 case +Arguments.of(1.0, 0.23, 0), +// Alpha close to 1 +Arguments.of(Math.nextUp(1.0), 0.23, 0), +// General case +Arguments.of(1.3, 0.1, 0), +// Small alpha case +Arguments.of(1e-5, 0.1, 0), +// Large alpha case. +// This hits the case for computing tau from (1-alpha) -> -1. +Arguments.of(1.99, 0.1, 0)); } /** @@ -2092,7 +2082,9 @@ class StableSamplerTest { * @param beta Beta. * @param ulp Allowed ULP difference. */ -private static void testTransformedSampler(double alpha, double beta, int ulp) { +@ParameterizedTest +@MethodSource +void testTransformedSampler(double alpha, double beta, int ulp) { final UniformRandomProvider[] rngs = RandomAssert.createRNG(2); final UniformRandomProvider rng1 = rngs[0]; final UniformRandomProvider rng2 = rngs[1]; @@ -2106,7 +2098,8 @@ class StableSamplerTest { for (int i = 0; i &
(commons-rng) 04/07: Update for next development version
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 808571bdd9cd744c7fd28a0f256480ff45009fac Author: Alex Herbert AuthorDate: Mon Jul 15 11:46:13 2024 +0100 Update for next development version --- commons-rng-bom/pom.xml| 4 ++-- commons-rng-client-api/pom.xml | 4 ++-- commons-rng-core/pom.xml | 6 ++--- commons-rng-docs/pom.xml | 10 commons-rng-examples/examples-jmh/pom.xml | 4 ++-- .../examples-jpms/jpms-app/pom.xml | 6 ++--- .../examples-jpms/jpms-lib/pom.xml | 4 ++-- commons-rng-examples/examples-jpms/pom.xml | 4 ++-- commons-rng-examples/examples-jpms/runApp.sh | 2 +- commons-rng-examples/examples-quadrature/pom.xml | 4 ++-- commons-rng-examples/examples-sampling/pom.xml | 4 ++-- commons-rng-examples/examples-stress/pom.xml | 4 ++-- commons-rng-examples/pom.xml | 10 commons-rng-integration/pom.xml| 8 +++ commons-rng-sampling/pom.xml | 8 +++ commons-rng-simple/pom.xml | 8 +++ dist-archive/pom.xml | 28 +++--- pom.xml| 4 ++-- 18 files changed, 61 insertions(+), 61 deletions(-) diff --git a/commons-rng-bom/pom.xml b/commons-rng-bom/pom.xml index 3ec5cb50..77e6b906 100644 --- a/commons-rng-bom/pom.xml +++ b/commons-rng-bom/pom.xml @@ -21,11 +21,11 @@ org.apache.commons commons-rng-parent -1.6-SNAPSHOT +1.7-SNAPSHOT commons-rng-bom - 1.6-SNAPSHOT + 1.7-SNAPSHOT Apache Commons RNG (Bill of Materials) pom diff --git a/commons-rng-client-api/pom.xml b/commons-rng-client-api/pom.xml index 3fcdeae3..d18570c2 100644 --- a/commons-rng-client-api/pom.xml +++ b/commons-rng-client-api/pom.xml @@ -21,11 +21,11 @@ org.apache.commons commons-rng-parent -1.6-SNAPSHOT +1.7-SNAPSHOT commons-rng-client-api - 1.6-SNAPSHOT + 1.7-SNAPSHOT Apache Commons RNG Client API API for client code that uses random numbers generators. diff --git a/commons-rng-core/pom.xml b/commons-rng-core/pom.xml index 2f78ea06..bb8bac2a 100644 --- a/commons-rng-core/pom.xml +++ b/commons-rng-core/pom.xml @@ -21,11 +21,11 @@ org.apache.commons commons-rng-parent -1.6-SNAPSHOT +1.7-SNAPSHOT commons-rng-core - 1.6-SNAPSHOT + 1.7-SNAPSHOT Apache Commons RNG Core Pure Java implementations of random numbers generator algorithms. @@ -61,7 +61,7 @@ org.apache.commons commons-rng-client-api - 1.6-SNAPSHOT + 1.7-SNAPSHOT diff --git a/commons-rng-docs/pom.xml b/commons-rng-docs/pom.xml index fe8a0e4f..c7ef024e 100644 --- a/commons-rng-docs/pom.xml +++ b/commons-rng-docs/pom.xml @@ -21,7 +21,7 @@ org.apache.commons commons-rng-parent -1.6-SNAPSHOT +1.7-SNAPSHOT commons-rng-docs @@ -63,22 +63,22 @@ org.apache.commons commons-rng-client-api - 1.6-SNAPSHOT + 1.7-SNAPSHOT org.apache.commons commons-rng-core - 1.6-SNAPSHOT + 1.7-SNAPSHOT org.apache.commons commons-rng-simple - 1.6-SNAPSHOT + 1.7-SNAPSHOT org.apache.commons commons-rng-sampling - 1.6-SNAPSHOT + 1.7-SNAPSHOT diff --git a/commons-rng-examples/examples-jmh/pom.xml b/commons-rng-examples/examples-jmh/pom.xml index 2d361a3a..dd7f3152 100644 --- a/commons-rng-examples/examples-jmh/pom.xml +++ b/commons-rng-examples/examples-jmh/pom.xml @@ -21,11 +21,11 @@ org.apache.commons commons-rng-examples -1.6-SNAPSHOT +1.7-SNAPSHOT commons-rng-examples-jmh - 1.6-SNAPSHOT + 1.7-SNAPSHOT Apache Commons RNG JMH Benchmark Code for running JMH benchmarks that assess the performance of the generators. diff --git a/commons-rng-examples/examples-jpms/jpms-app/pom.xml b/commons-rng-examples/examples-jpms/jpms-app/pom.xml index d851ae3c..f083c895 100644 --- a/commons-rng-examples/examples-jpms/jpms-app/pom.xml +++ b/commons-rng-examples/examples-jpms/jpms-app/pom.xml @@ -21,11 +21,11 @@ org.apache.commons commons-rng-examples-jpms -1.6-SNAPSHOT +1.7-SNAPSHOT commons-rng-examples-jpms-app - 1.6-SNAPSHOT + 1.7-SNAPSHOT Apache Commons RNG JPMS Module Example (Application) Testing JPMS. Code in this module is not part of the public API. @@ -39,7 +39,7 @@ org.apache.commons commons-rng-examples-jpms-lib - 1.6-SNAPSHOT + 1.7-SNAPSHOT diff --git a/commons-rng-examples/examples-jpms/jpms-lib/pom.xml b/commons-rng-examples
(commons-rng) 06/07: Bump versions for next development cycle
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 f5e60d6fe141f019887619a1e8aaa506edb84d59 Author: Alex Herbert AuthorDate: Mon Jul 15 12:37:14 2024 +0100 Bump versions for next development cycle --- .../resources/org/apache/commons/rng/integration/tests.bndrun | 10 +- pom.xml| 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/commons-rng-integration/src/test/resources/org/apache/commons/rng/integration/tests.bndrun b/commons-rng-integration/src/test/resources/org/apache/commons/rng/integration/tests.bndrun index a968aa4d..179e2d7b 100644 --- a/commons-rng-integration/src/test/resources/org/apache/commons/rng/integration/tests.bndrun +++ b/commons-rng-integration/src/test/resources/org/apache/commons/rng/integration/tests.bndrun @@ -28,11 +28,11 @@ Test-Cases: ${classes;CONCRETE;PUBLIC;NAMED;*Test*} # Generated using: mvn package bnd-resolver:resolve -runbundles: \ org.opentest4j;version='[1.3.0,1.3.1)',\ - commons-rng-integration-tests;version='[1.6.0,1.6.1)',\ - org.apache.commons.rng;version='[1.6.0,1.6.1)',\ - org.apache.commons.rng.core;version='[1.6.0,1.6.1)',\ - org.apache.commons.rng.sampling;version='[1.6.0,1.6.1)',\ - org.apache.commons.rng.simple;version='[1.6.0,1.6.1)',\ + commons-rng-integration-tests;version='[1.7.0,1.7.1)',\ + org.apache.commons.rng;version='[1.7.0,1.7.1)',\ + org.apache.commons.rng.core;version='[1.7.0,1.7.1)',\ + org.apache.commons.rng.sampling;version='[1.7.0,1.7.1)',\ + org.apache.commons.rng.simple;version='[1.7.0,1.7.1)',\ junit-jupiter-api;version='[5.11.0,5.11.1)',\ junit-jupiter-engine;version='[5.11.0,5.11.1)',\ junit-platform-commons;version='[1.11.0,1.11.1)',\ diff --git a/pom.xml b/pom.xml index 6223fbf3..f7d177f7 100644 --- a/pom.xml +++ b/pom.xml @@ -47,8 +47,8 @@ 2024-07-15T00:00:00Z ${rng.build.outputTimestamp} -1.6 -1.5 +1.7 +1.6 RC1 (requires Java 8+) -bin
(commons-rng) 03/07: Update following 1.6 release
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 51a17f6a887f54d26c4e4ceb599818342ec4acab Author: Alex Herbert AuthorDate: Mon Jul 15 11:42:44 2024 +0100 Update following 1.6 release --- RELEASE-NOTES.txt | 62 ++ commons-rng-bom/pom.xml| 1 + commons-rng-bom/src/site/xdoc/index.xml| 2 +- commons-rng-client-api/src/site/site.xml | 2 + commons-rng-core/src/site/site.xml | 2 + commons-rng-examples/examples-jmh/pom.xml | 1 + commons-rng-sampling/src/site/site.xml | 2 + commons-rng-simple/src/site/site.xml | 2 + src/changes/changes.xml| 7 ++- .../resources/release-notes/RELEASE-NOTES-1.6.txt | 62 ++ src/site/xdoc/download_rng.xml | 28 +- 11 files changed, 155 insertions(+), 16 deletions(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index ea2338d9..ba9a1a20 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,4 +1,66 @@ + Apache Commons RNG 1.6 RELEASE NOTES + +The Apache Commons RNG team is pleased to announce the release of Apache Commons RNG 1.6 + +The Apache Commons RNG project provides pure-Java implementation of pseudo-random generators. + +New features, updates and bug fixes (requires Java 8). + +Apache Commons RNG 1.6 contains the following library modules: + commons-rng-client-api (requires Java 8) + commons-rng-core (requires Java 8) + commons-rng-simple (requires Java 8) + commons-rng-sampling (requires Java 8) + commons-rng-bom + +The code in module 'commons-rng-core' should not be accessed +directly by applications; generators should be created using +the 'commons-rng-simple' module. + +Additional code is provided in the following modules: + commons-rng-examples-quadrature (requires Java 8) + commons-rng-examples-jmh (requires Java 8) + commons-rng-examples-sampling (requires Java 8) + commons-rng-examples-stress (requires Java 8) + commons-rng-examples-jpms (requires Java 11) + +It is however not part of the official API and no compatibility +should be expected in subsequent releases. + +It must be noted that, due to the nature of random number generation, some unit tests +are bound to fail with some probability. The 'maven-surefire-plugin' is configured +to re-run tests that fail, and pass the build if they succeed within the allotted +number of reruns (the test will be marked as 'flaky' in the report). + +The source output type (int/long) of a RNG must maintain behavioural compatibility +between releases; derived types may break behavioural compatibility. Any functional +changes will be recorded in the release notes. + +Changes in this version include: + +New features: +o RNG-186: Correct the module OSGi exports. Use of multiple modules is validated in an OSGi +integration test. +o RNG-184: New "ArraySampler" to support shuffling primitive and generic arrays with +sub-range support. + + +Changes: +o RNG-183: "InverseTransformParetoSampler": Modified to concentrate samples at the distribution +lower/upper bounds for extreme shape parameters. Eliminates generation of outlier +infinite samples and NaN samples under certain conditions. Changes sampling to use +the RNG nextLong() method in-place of nextDouble(). + + +For complete information on Apache Commons RNG, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache Commons RNG website: + +https://commons.apache.org/proper/commons-rng/ + + += + Apache Commons RNG 1.5 RELEASE NOTES The Apache Commons RNG team is pleased to announce the release of Apache Commons RNG 1.5 diff --git a/commons-rng-bom/pom.xml b/commons-rng-bom/pom.xml index b40c414a..3ec5cb50 100644 --- a/commons-rng-bom/pom.xml +++ b/commons-rng-bom/pom.xml @@ -62,6 +62,7 @@ true true +true true true true diff --git a/commons-rng-bom/src/site/xdoc/index.xml b/commons-rng-bom/src/site/xdoc/index.xml index 061f35e7..936277b4 100644 --- a/commons-rng-bom/src/site/xdoc/index.xml +++ b/commons-rng-bom/src/site/xdoc/index.xml @@ -49,7 +49,7 @@ org.apache.commons commons-rng-bom - 1.5 + 1.6 pom import diff --git a/commons-rng-client-api/src/site/site.xml b/commons-rng-client-api/src/site/site.xml index c972543a..cc72c0ef 100644 --- a/commons-rng-client-api/src/site/site.xml +++ b/commons-rng-client-api/src/site/site.xml @@ -28,6 +28,8 @@ + https://commons.apache.org/rng/commons-rng-client-api/javadocs/api-1.6/index.html"/> ht
(commons-rng) 02/07: Javadoc test helper methods
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 013b1e2fb2e1a35129a7a755099737dc399fdde9 Author: Alex Herbert AuthorDate: Tue Jul 9 15:35:45 2024 +0100 Javadoc test helper methods --- .../src/test/java/org/apache/commons/rng/sampling/RandomAssert.java | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java index 3387d964..f43d23bd 100644 --- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java +++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/RandomAssert.java @@ -180,6 +180,7 @@ public final class RandomAssert { * * @return the uniform random provider * @see RandomSource#create() + * @see #createRNG(int) */ public static UniformRandomProvider createRNG() { return SOURCES[ThreadLocalRandom.current().nextInt(SOURCES.length)].create(); @@ -206,6 +207,7 @@ public final class RandomAssert { * @return the uniform random provider * @see RandomSource#create() * @see RandomSource#createSeed() + * @see #createRNG() */ public static UniformRandomProvider[] createRNG(int count) { final RandomSource source = SOURCES[ThreadLocalRandom.current().nextInt(SOURCES.length)]; @@ -236,8 +238,8 @@ public final class RandomAssert { * * It should be noted that repeat invocations of a failing test by the surefire plugin * will receive an instance with the same seed. If a test may fail due to stochastic conditions - * then consider using {@link RandomAssert#createRNG()} which will obtain a different RNG - * for repeat test executions. + * then consider using {@link RandomAssert#createRNG()} or {@link #createRNG(int)} which will + * obtain a different RNG for repeat test executions. * * @return the uniform random provider * @see RandomSource#create()
(commons-rng) 07/07: Update release notes
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 f1a6ed79d85ed32c33cb5befdde29d97eeabb99f Author: Alex Herbert AuthorDate: Mon Jul 15 12:53:14 2024 +0100 Update release notes --- doc/release/release.howto.txt | 325 -- 1 file changed, 190 insertions(+), 135 deletions(-) diff --git a/doc/release/release.howto.txt b/doc/release/release.howto.txt index 24b8717c..14fe6f8e 100644 --- a/doc/release/release.howto.txt +++ b/doc/release/release.howto.txt @@ -75,11 +75,11 @@ NOTE When performing a release it is good practice to edit a copy of these notes during the process and merge the updated document into the repository following a release. To assist in this process a find-and-replace can be performed to update all the version numbers in order. For example -based on a previous release of 1.5: +based on a previous release of 1.6: -- Next development version : 1.6 -> 1.7 -- Next release version : 1.5 -> 1.6 -- Previous release version : 1.4 -> 1.5 +- Next development version : 1.7 -> 1.8 +- Next release version : 1.6 -> 1.7 +- Previous release version : 1.5 -> 1.6 - Release candidate version : RC1 -> RC2 (if applicable) This allows the included commands to be coped during the release process. @@ -95,9 +95,9 @@ Preliminary checks: - 1.5 + 1.6 - 1.4 + 1.5 Check all the issues reported by the "japicmp" plugin. @@ -126,10 +126,10 @@ that the build process can create all the necessary artifacts. The "dist-archive/target" directory will contain those files: -commons-rng-1.5-SNAPSHOT-bin.tar.gz -commons-rng-1.5-SNAPSHOT-bin.zip -commons-rng-1.5-SNAPSHOT-src.tar.gz -commons-rng-1.5-SNAPSHOT-src.zip +commons-rng-1.6-SNAPSHOT-bin.tar.gz +commons-rng-1.6-SNAPSHOT-bin.zip +commons-rng-1.6-SNAPSHOT-src.tar.gz +commons-rng-1.6-SNAPSHOT-src.zip At some point when processing the above command, the GPG passphrase will be requested; to avoid problems, the "gpg2" executable should be specified in @@ -169,18 +169,18 @@ candidate, create it locally starting from the master branch or the version branch and push it to Apache repository (assuming it is called origin), remembering the binding between the local and remote origin branches: - $ git branch 1.5-release - $ git push -u origin 1.5-release + $ git branch 1.6-release + $ git push -u origin 1.6-release -(Optional) -Modify the dist-archive/pom.xml to update the release manager name and GPG signing key -to be used for the release. +Note that the the release manager name and GPG signing key to be used for the release +should be defined in the .m2/settings.xml +(see https://commons.apache.org/releases/prepare.html). (3) Switch to the release branch: - $ git checkout 1.5-release + $ git checkout 1.6-release (4) @@ -188,8 +188,8 @@ If there have been changes committed in the master branch or the version branch since the creation of the release branch, there are two cases: (4a) - if all these changes must be included in version 1.5, merge "master" - or the version branch into "1.5-release": + if all these changes must be included in version 1.6, merge "master" + or the version branch into "1.6-release": $ git merge master @@ -198,15 +198,15 @@ branch since the creation of the release branch, there are two cases: $ git merge RNG_1_X (4b) - if only part of these changes must be included in version 1.5, - cherry-pick the required commits into the "1.5-release" branch: + if only part of these changes must be included in version 1.6, + cherry-pick the required commits into the "1.6-release" branch: $ git cherry-pick commit-SHA (5) Update the release specific files, checking you are really working on the -1.5-release branch and *not* on the master branch. +1.6-release branch and *not* on the master branch. In particular: * Update and commit the "src/site/site.xml" file to contain the information @@ -215,14 +215,14 @@ In particular: * Estimate a release date (taking into account the release vote delay) and insert it in the "src/changes/changes.xml" file. * Update the "pom.xml" to contain the final version number and not a SNAPSHOT: - Assuming that the release version will be "1.5", modify the "" tag to + Assuming that the release version will be "1.6", modify the "" tag to read: -1.5 +1.6 This can be done using maven: -$ mvn versions:set -DnewVersion=1.5 -DgenerateBackupPoms=false +$ mvn versions:set -DnewVersion=1.6 -DgenerateBackupPoms=false Modify t
(commons-build-plugin) branch master updated: Remove trailing space
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-build-plugin.git The following commit(s) were added to refs/heads/master by this push: new d94c9cb Remove trailing space d94c9cb is described below commit d94c9cbcfa3919c66096f4fbfb747e870cc95b6e Author: Alex Herbert AuthorDate: Mon Jul 15 12:30:09 2024 +0100 Remove trailing space --- src/main/resources/commons-xdoc-templates/readme-md-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/commons-xdoc-templates/readme-md-template.md b/src/main/resources/commons-xdoc-templates/readme-md-template.md index 035dbea..7dc9899 100644 --- a/src/main/resources/commons-xdoc-templates/readme-md-template.md +++ b/src/main/resources/commons-xdoc-templates/readme-md-template.md @@ -75,7 +75,7 @@ Alternatively, you can pull it from the central Maven repositories: Building -Building requires a Java JDK and [Apache Maven](https://maven.apache.org/). +Building requires a Java JDK and [Apache Maven](https://maven.apache.org/). The required Java version is found in the `pom.xml` as the `maven.compiler.source` property. From a command shell, run `mvn` without arguments to invoke the default Maven goal to run all tests and checks.
(commons-build-plugin) branch master updated: Remove double space
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-build-plugin.git The following commit(s) were added to refs/heads/master by this push: new 4b2d396 Remove double space 4b2d396 is described below commit 4b2d39666aca40302e017a62d365bd80dfeed15c Author: Alex Herbert AuthorDate: Mon Jul 15 11:58:53 2024 +0100 Remove double space --- src/main/resources/commons-xdoc-templates/readme-md-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/commons-xdoc-templates/readme-md-template.md b/src/main/resources/commons-xdoc-templates/readme-md-template.md index a4438b0..035dbea 100644 --- a/src/main/resources/commons-xdoc-templates/readme-md-template.md +++ b/src/main/resources/commons-xdoc-templates/readme-md-template.md @@ -62,7 +62,7 @@ Getting the latest release -- You can download source and binaries from our [download page](https://commons.apache.org/proper/commons-@ID@/download_@ID@.cgi). -Alternatively, you can pull it from the central Maven repositories: +Alternatively, you can pull it from the central Maven repositories: ```xml
svn commit: r1919244 - /commons/cms-site/trunk/doap/doap_rng.rdf
Author: aherbert Date: Mon Jul 15 10:12:15 2024 New Revision: 1919244 URL: http://svn.apache.org/viewvc?rev=1919244=rev Log: Commons RNG v1.6 was released (from RC2) Modified: commons/cms-site/trunk/doap/doap_rng.rdf Modified: commons/cms-site/trunk/doap/doap_rng.rdf URL: http://svn.apache.org/viewvc/commons/cms-site/trunk/doap/doap_rng.rdf?rev=1919244=1919243=1919244=diff == --- commons/cms-site/trunk/doap/doap_rng.rdf (original) +++ commons/cms-site/trunk/doap/doap_rng.rdf Mon Jul 15 10:12:15 2024 @@ -43,6 +43,13 @@ commons-rng +2024-07-15 +1.6 + + + + +commons-rng 2022-10-10 1.5
svn commit: r1919243 - /commons/cms-site/trunk/conf/component_releases.properties
Author: aherbert Date: Mon Jul 15 10:07:41 2024 New Revision: 1919243 URL: http://svn.apache.org/viewvc?rev=1919243=rev Log: Commons RNG v1.6 was released (from RC2) Modified: commons/cms-site/trunk/conf/component_releases.properties Modified: commons/cms-site/trunk/conf/component_releases.properties URL: http://svn.apache.org/viewvc/commons/cms-site/trunk/conf/component_releases.properties?rev=1919243=1919242=1919243=diff == --- commons/cms-site/trunk/conf/component_releases.properties (original) +++ commons/cms-site/trunk/conf/component_releases.properties Mon Jul 15 10:07:41 2024 @@ -67,8 +67,8 @@ poolVersion=2.12.0 poolReleased=2023-09-30 rdfVersion=0.5.0 rdfReleased=2017-12-23 -rngVersion=1.5 -rngReleased=2022-10-10 +rngVersion=1.6 +rngReleased=2024-07-15 scxmlVersion=0.9 scxmlReleased=2008-12-01 statisticsVersion=1.0
(commons-rng) annotated tag rel/commons-rng-1.6 updated (618490cf -> 0b06800b)
This is an automated email from the ASF dual-hosted git repository. aherbert pushed a change to annotated tag rel/commons-rng-1.6 in repository https://gitbox.apache.org/repos/asf/commons-rng.git *** WARNING: tag rel/commons-rng-1.6 was modified! *** from 618490cf (commit) to 0b06800b (tag) tagging 618490cf3f072ddc327de90109fac04f404831cb (commit) replaces commons-rng-1.6-RC1 by Alex Herbert on Mon Jul 15 10:38:51 2024 +0100 - Log - RC2 becomes v1.6 official release. -BEGIN PGP SIGNATURE- iQIzBAABCAAdFiEEvIej/QpUSA8Lrb69IZOf8MoqZWcFAmaU7isACgkQIZOf8Moq ZWd19hAAlBywZwkdYBUhhuBWgWzucaAIjCIzWLEKz5vawCsEPsa4vT0QGxzPH4Z0 xHZ1OCTG85X3isEMib6ByGFAvXtAKOze6j/m67APSbpxn2Fvv6Aa+GkRsC9GLcY2 W6AxHJW+JMkUALfrXmAWiMNEufHCWGZsCKsnKn7KdmwKfS8Ue01/WcWe7XlJIswf A9nXkA/3dmCKjLeihi0T5KgUg5Ze1g7JUVTm4hTHpaGDmOdndEU6db+uifRX2W5j h1FIeECmJp7gU+bhddepb2gK3tlynGg+FKJ2YKXHgmwNLedBnQvhp7DTyo0hzxoN nlNN//MlMwoak4wFE+4u7OqGR+c0G0ZqgjH62++X+73VQ1//1Oclkx7jKdDCN5mz oTqKu09xJP9vWV3Snae4yZBVy1h3TSlXhg7DsS0BzUJGkfA9Zf2RvYf/kuLLA1ds G4+oHIx3qpSTfUviBjMSD3lULmDB5GhsXoW+NveVy0OjBXdPkRY1a+IzSpMi43NL UjUxiuq0NZ8N1lP/6G7CYBM3XfLj34K9kdTTUAFCXfcmXj1E6zB/mVcxBHHhu97S y9VoAevZEZPsXIx5nVI7FbbZgzZZ1pwf3SupJQIRSCpU8tqok0Igpcj0xsTCoSq+ 3a8mCqxiF038dCAJWf1GOLRXWU4vc1X/9nHSda6anz+yTZP+wZo= =iu/d -END PGP SIGNATURE- --- No new revisions were added by this update. Summary of changes:
svn commit: r70305 - in /release/commons/rng: ./ binaries/ source/
Author: aherbert Date: Mon Jul 15 08:56:41 2024 New Revision: 70305 Log: Release Commons RNG v1.6 (from RC2). Added: release/commons/rng/binaries/commons-rng-1.6-bin.tar.gz (with props) release/commons/rng/binaries/commons-rng-1.6-bin.tar.gz.asc release/commons/rng/binaries/commons-rng-1.6-bin.tar.gz.sha512 release/commons/rng/binaries/commons-rng-1.6-bin.zip (with props) release/commons/rng/binaries/commons-rng-1.6-bin.zip.asc release/commons/rng/binaries/commons-rng-1.6-bin.zip.sha512 release/commons/rng/source/commons-rng-1.6-src.tar.gz (with props) release/commons/rng/source/commons-rng-1.6-src.tar.gz.asc release/commons/rng/source/commons-rng-1.6-src.tar.gz.sha512 release/commons/rng/source/commons-rng-1.6-src.zip (with props) release/commons/rng/source/commons-rng-1.6-src.zip.asc release/commons/rng/source/commons-rng-1.6-src.zip.sha512 Removed: release/commons/rng/binaries/commons-rng-1.5-bin.tar.gz release/commons/rng/binaries/commons-rng-1.5-bin.tar.gz.asc release/commons/rng/binaries/commons-rng-1.5-bin.tar.gz.sha512 release/commons/rng/binaries/commons-rng-1.5-bin.zip release/commons/rng/binaries/commons-rng-1.5-bin.zip.asc release/commons/rng/binaries/commons-rng-1.5-bin.zip.sha512 release/commons/rng/source/commons-rng-1.5-src.tar.gz release/commons/rng/source/commons-rng-1.5-src.tar.gz.asc release/commons/rng/source/commons-rng-1.5-src.tar.gz.sha512 release/commons/rng/source/commons-rng-1.5-src.zip release/commons/rng/source/commons-rng-1.5-src.zip.asc release/commons/rng/source/commons-rng-1.5-src.zip.sha512 Modified: release/commons/rng/README.html release/commons/rng/RELEASE-NOTES.txt Modified: release/commons/rng/README.html == --- release/commons/rng/README.html (original) +++ release/commons/rng/README.html Mon Jul 15 08:56:41 2024 @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. --> -Commons-RNG v1.5. +Commons-RNG v1.6. -This is the 1.5 version of commons-rng. It is available in both binary and source distributions. +This is the 1.6 version of commons-rng. It is available in both binary and source distributions. Note: @@ -28,7 +28,7 @@ The changes in this release are detailed in the release notes. -Thank you for using https://commons.apache.org/proper/commons-rng/;>RNG. +Thank you for using https://commons.apache.org/proper/commons-rng/commons-rng/;>RNG. From the Apache Commons Projecthttps://commons.apache.org/;>https://commons.apache.org/ @@ -48,19 +48,19 @@ there will be an accompanying file.asc signature file in the same directory as the file (binaries/ or source/). The signing keys can be found in the distribution directory at http://www.apache.org/dist/commons/KEYS;>http://www.apache.org/dist/commons/KEYS. + HREF="http://downloads.apache.org/commons/KEYS;>http://downloads.apache.org/commons/KEYS. Always download the KEYS file directly from the Apache site, never from a mirror site. Always test available signatures, e.g., $ pgpk -a KEYS -$ pgpv commons-rng-1.5-bin.tar.gz.asc +$ pgpv commons-rng-1.6-bin.tar.gz.asc or, $ pgp -ka KEYS -$ pgp commons-rng-1.5-bin.tar.gz.asc +$ pgp commons-rng-1.6-bin.tar.gz.asc or, $ gpg --import KEYS -$ gpg --verify commons-rng-1.5-bin.tar.gz.asc +$ gpg --verify commons-rng-1.6-bin.tar.gz.asc - + \ No newline at end of file Modified: release/commons/rng/RELEASE-NOTES.txt == --- release/commons/rng/RELEASE-NOTES.txt (original) +++ release/commons/rng/RELEASE-NOTES.txt Mon Jul 15 08:56:41 2024 @@ -1,4 +1,66 @@ + Apache Commons RNG 1.6 RELEASE NOTES + +The Apache Commons RNG team is pleased to announce the release of Apache Commons RNG 1.6 + +The Apache Commons RNG project provides pure-Java implementation of pseudo-random generators. + +New features, updates and bug fixes (requires Java 8). + +Apache Commons RNG 1.6 contains the following library modules: + commons-rng-client-api (requires Java 8) + commons-rng-core (requires Java 8) + commons-rng-simple (requires Java 8) + commons-rng-sampling (requires Java 8) + commons-rng-bom + +The code in module 'commons-rng-core' should not be accessed +directly by applications; generators should be created using +the 'commons-rng-simple' module. + +Additional code is provided in the following modules: + commons-rng-examples-quadrature (requires Java 8) + commons-rng-examples-jmh (requires Java 8) + commons-rng-examples-sampling (requires Java 8) + commons-rng-examples-stress (requires Java 8) + commons-rng-examples-jpms (requires Java 11) + +It is however not part of the official API and no compatibility +should be expected in subsequent releases. + +It must be noted
(commons-numbers) branch master updated: javadoc clarification
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-numbers.git The following commit(s) were added to refs/heads/master by this push: new ad6dc841 javadoc clarification ad6dc841 is described below commit ad6dc8419cf4ea133dcda8e4c20074e28a355f22 Author: Alex Herbert AuthorDate: Tue Jul 9 14:51:21 2024 +0100 javadoc clarification --- .../src/main/java/org/apache/commons/numbers/field/Field.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java index 2d99acd5..d2866539 100644 --- a/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java +++ b/commons-numbers-field/src/main/java/org/apache/commons/numbers/field/Field.java @@ -49,7 +49,7 @@ public interface Field { T negate(T a); /** - * Multiply the element {@code a} a number of times {@code n}. + * Multiply the element {@code a} by a specified number of times {@code n}. * * @param a Field element. * @param n Number of times {@code a} must be added to itself.
(commons-numbers) branch master updated (cc0d4d02 -> 20e57acd)
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-numbers.git from cc0d4d02 Update profile name in referencing documents new ffd322b5 Javadoc protected/public constructors and methods new 20e57acd Add JDK 21 to GH maven workflow The 2 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: .github/workflows/maven.yml| 2 +- .../java/org/apache/commons/numbers/angle/Angle.java | 18 ++ .../java/org/apache/commons/numbers/angle/Reduce.java | 2 ++ .../commons/numbers/combinatorics/Combinations.java| 2 ++ .../apache/commons/numbers/field/AbstractField.java| 3 +++ .../apache/commons/numbers/field/BigFractionField.java | 6 +- .../java/org/apache/commons/numbers/field/DDField.java | 6 +- .../org/apache/commons/numbers/field/FP64Field.java| 6 +- .../java/org/apache/commons/numbers/field/Field.java | 18 ++ .../apache/commons/numbers/field/FractionField.java| 6 +- .../commons/numbers/fraction/ContinuedFraction.java| 3 +++ .../commons/numbers/gamma/LanczosApproximation.java| 4 +++- src/conf/pmd/pmd-ruleset.xml | 4 13 files changed, 74 insertions(+), 6 deletions(-)
(commons-numbers) 02/02: Add JDK 21 to GH maven workflow
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-numbers.git commit 20e57acd54d29a3d3c881aa5f71a80e06a5b1cfe Author: Alex Herbert AuthorDate: Tue Jul 9 14:46:01 2024 +0100 Add JDK 21 to GH maven workflow --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 661e1e87..6ad515f8 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: -java: [ 8, 11, 17 ] +java: [ 8, 11, 17, 21 ] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 4.1.1
(commons-numbers) 01/02: Javadoc protected/public constructors and methods
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-numbers.git commit ffd322b5761b4d5676ea5d64235fcf7974b785bc Author: Alex Herbert AuthorDate: Tue Jul 9 14:44:37 2024 +0100 Javadoc protected/public constructors and methods Added to avoid warnings when building on Java 21 (which fail the build). This requires adding implicit public constructors. --- .../java/org/apache/commons/numbers/angle/Angle.java | 18 ++ .../java/org/apache/commons/numbers/angle/Reduce.java | 2 ++ .../commons/numbers/combinatorics/Combinations.java| 2 ++ .../apache/commons/numbers/field/AbstractField.java| 3 +++ .../apache/commons/numbers/field/BigFractionField.java | 6 +- .../java/org/apache/commons/numbers/field/DDField.java | 6 +- .../org/apache/commons/numbers/field/FP64Field.java| 6 +- .../java/org/apache/commons/numbers/field/Field.java | 18 ++ .../apache/commons/numbers/field/FractionField.java| 6 +- .../commons/numbers/fraction/ContinuedFraction.java| 3 +++ .../commons/numbers/gamma/LanczosApproximation.java| 4 +++- src/conf/pmd/pmd-ruleset.xml | 4 12 files changed, 73 insertions(+), 5 deletions(-) diff --git a/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Angle.java b/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Angle.java index d38c3c8d..2f50e816 100644 --- a/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Angle.java +++ b/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Angle.java @@ -74,16 +74,22 @@ public abstract class Angle implements DoubleSupplier { } /** + * Convert to a {@link Turn}. + * * @return the angle in https://en.wikipedia.org/wiki/Turn_%28geometry%29;>turns. */ public abstract Turn toTurn(); /** + * Convert to a {@link Rad}. + * * @return the angle in https://en.wikipedia.org/wiki/Radian;>radians. */ public abstract Rad toRad(); /** + * Convert to a {@link Deg}. + * * @return the angle in https://en.wikipedia.org/wiki/Degree_%28angle%29;>degrees. */ public abstract Deg toDeg(); @@ -98,6 +104,8 @@ public abstract class Angle implements DoubleSupplier { public static final DoubleUnaryOperator WITHIN_0_AND_1 = normalizer(0d); /** + * Create an instance. + * * @param angle (in turns). */ private Turn(final double angle) { @@ -105,6 +113,8 @@ public abstract class Angle implements DoubleSupplier { } /** + * Create an instance. + * * @param angle (in turns). * @return a new instance. */ @@ -158,6 +168,8 @@ public abstract class Angle implements DoubleSupplier { public static final DoubleUnaryOperator WITHIN_MINUS_PI_AND_PI = normalizer(-Math.PI); /** + * Create an instance. + * * @param angle (in radians). */ private Rad(final double angle) { @@ -165,6 +177,8 @@ public abstract class Angle implements DoubleSupplier { } /** + * Create an instance. + * * @param angle (in radians). * @return a new instance. */ @@ -212,6 +226,8 @@ public abstract class Angle implements DoubleSupplier { public static final DoubleUnaryOperator WITHIN_0_AND_360 = normalizer(0d); /** + * Create an instance. + * * @param angle (in degrees). */ private Deg(final double angle) { @@ -219,6 +235,8 @@ public abstract class Angle implements DoubleSupplier { } /** + * Create an instance. + * * @param angle (in degrees). * @return a new instance. */ diff --git a/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Reduce.java b/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Reduce.java index 7123c2d6..751378c5 100644 --- a/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Reduce.java +++ b/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Reduce.java @@ -31,6 +31,8 @@ public class Reduce implements DoubleUnaryOperator { private final double period; /** + * Create an instance. + * * @param offset Value that will be mapped to {@code 0}. * @param period Period. */ diff --git a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/Combinations.java b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/Combinations.java index 959d2df4..8e5edbfa 100644 --- a/commons-numbers-combinatorics/src/main/java/org/apach
(commons-statistics) branch master updated: Do not fail on javadoc warnings for the JMH module
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-statistics.git The following commit(s) were added to refs/heads/master by this push: new e43197d Do not fail on javadoc warnings for the JMH module e43197d is described below commit e43197d8b0f22bba15843041f2951f94aee6178a Author: Alex Herbert AuthorDate: Tue Jul 9 14:35:58 2024 +0100 Do not fail on javadoc warnings for the JMH module --- commons-statistics-examples/examples-jmh/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commons-statistics-examples/examples-jmh/pom.xml b/commons-statistics-examples/examples-jmh/pom.xml index 4e79c1a..902eaf5 100644 --- a/commons-statistics-examples/examples-jmh/pom.xml +++ b/commons-statistics-examples/examples-jmh/pom.xml @@ -137,6 +137,7 @@ **/jmh_generated/*.java + false @@ -159,6 +160,7 @@ **/jmh_generated/*.java + false
(commons-statistics) branch master updated: Add JDK 21 to GH maven workflow
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-statistics.git The following commit(s) were added to refs/heads/master by this push: new 448d2e3 Add JDK 21 to GH maven workflow 448d2e3 is described below commit 448d2e3f4979489b86a42b2a692b773b17184298 Author: Alex Herbert AuthorDate: Tue Jul 9 14:26:02 2024 +0100 Add JDK 21 to GH maven workflow --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index fd91c6c..66790dc 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: -java: [ 8, 11, 17 ] +java: [ 8, 11, 17, 21 ] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 4.1.1
(commons-rng) branch master updated: Revert "Update the fail/report criticality for revapi"
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 The following commit(s) were added to refs/heads/master by this push: new 390021b4 Revert "Update the fail/report criticality for revapi" 390021b4 is described below commit 390021b4a8b2a52437dd849e430367d6dd96446f Author: Alex Herbert AuthorDate: Tue Jul 9 13:55:16 2024 +0100 Revert "Update the fail/report criticality for revapi" This reverts commit 8603e6d73757256fc18fadfe0db2a65de05aac05. A check of the source code for revapi 0.15 shows that the value of reportCriticality is not used. Only the value of reportSeverity is used in the ReportMojo. --- pom.xml | 4 1 file changed, 4 insertions(+) diff --git a/pom.xml b/pom.xml index 997333f9..a114a016 100644 --- a/pom.xml +++ b/pom.xml @@ -666,6 +666,10 @@ This is avoided by creating an empty directory when svn is not available. + + equivalent + allowed
(commons-release-plugin) branch master updated: Grammar correction
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-release-plugin.git The following commit(s) were added to refs/heads/master by this push: new a329615 Grammar correction a329615 is described below commit a32961539df43d5d3855620eaabb32fbabf5f65b Author: Alex Herbert AuthorDate: Tue Jul 9 13:08:26 2024 +0100 Grammar correction --- src/main/resources/commons-xdoc-templates/vote-txt-template.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/commons-xdoc-templates/vote-txt-template.txt b/src/main/resources/commons-xdoc-templates/vote-txt-template.txt index 038539e..594ae21 100755 --- a/src/main/resources/commons-xdoc-templates/vote-txt-template.txt +++ b/src/main/resources/commons-xdoc-templates/vote-txt-template.txt @@ -86,7 +86,7 @@ Thank you, @RMNAME@, Release Manager (using key @RMKEY@) -For following is intended as a helper and refresher for reviewers. +The following is intended as a helper and refresher for reviewers. Validating a release candidate ==
svn commit: r70197 - /dev/commons/rng/1.6-RC2/site/
Author: aherbert Date: Tue Jul 9 11:47:49 2024 New Revision: 70197 Log: Distribution files for Commons RNG v1.6 (RC2). Removed: dev/commons/rng/1.6-RC2/site/
svn commit: r70195 - in /dev/commons/rng/1.6-RC2: ./ binaries/ site/ site/css/ site/images/ site/images/logos/ site/images/userguide/ site/images/userguide/dist_density_approx/ site/img/ site/js/ site
Author: aherbert Date: Tue Jul 9 11:32:33 2024 New Revision: 70195 Log: Staging release: commons-rng, version: 1.6 [This commit notification would consist of 461 parts, which exceeds the limit of 50 ones, so it was shortened to the summary.]
svn commit: r70194 - /dev/commons/rng/1.6-RC1/
Author: aherbert Date: Tue Jul 9 11:29:33 2024 New Revision: 70194 Log: Cleaning distribution area for: commons-rng Removed: dev/commons/rng/1.6-RC1/
(commons-rng) annotated tag commons-rng-1.6-RC2 updated (618490cf -> 3beb5503)
This is an automated email from the ASF dual-hosted git repository. aherbert pushed a change to annotated tag commons-rng-1.6-RC2 in repository https://gitbox.apache.org/repos/asf/commons-rng.git *** WARNING: tag commons-rng-1.6-RC2 was modified! *** from 618490cf (commit) to 3beb5503 (tag) tagging 618490cf3f072ddc327de90109fac04f404831cb (commit) replaces commons-rng-1.6-RC1 by Alex Herbert on Tue Jul 9 12:22:34 2024 +0100 - Log - RC2. -BEGIN PGP SIGNATURE- iQIzBAABCAAdFiEEvIej/QpUSA8Lrb69IZOf8MoqZWcFAmaNHXoACgkQIZOf8Moq ZWc8Wg/+KxqInYY2lGCtXDaeXLbkFFNc1hCpfvO2fG4H1DNLyw2Ll+YB3MLEFPHB NN7Vx7V/b1lP7u9AeTQGxmHWGCF6g8sh7HS/inWH47oAhSKM4Hu30TvmEulKaKh0 5ximIuiVyUvaxVwqJ5+IhclM4dszzi7UL/eJ88uUgHv+u4nqLMeBcWevEp0HD6mH dYlrHF1tzEZKanTuJnpIO9RWk29HTtKfmUoUYp4P+mvRpsZSJ7N0g39+yX052D1G gzW6vepOQirZfXEjybov1zHM8Hfe1X8g48ZEfbFtibidorb9+utPFIx/fs+vbOX5 4loZ0xnA8ZQA4fHh+b6kRB56p2yhF7K5EFB+VyFW6PV29vEpDgvRN0S6u/Zl3p1W ZYXGpWtiDjt/eb6e8oX2CwH7xcUzy9vWWi4sKC/DiF+ikhBe/QIPlAoI5kzrLmAA mePbpKiAIiuoCeVokBYvC8w8h2c+1X4Qxwm2KoVfoj1EM4kR/imgYxKNGrFqK8vB 3rSSYMY9ZWOb73DYKBRvF0J7tUZa0IjrG+ZfVs0AA1F9x9HPQ7clW31GsU8uth6y EeSvKUgpok1s5/7VRmrEMYH7c33sMHsexO+eml3k1CPeQ6ymaylMyqTH6v7XsBRs zdS+VspsRXnvtz7HnHHa2NaGHdcPcPvNeL1o32YiqVmKMISkY5A= =kilz -END PGP SIGNATURE- --- No new revisions were added by this update. Summary of changes:
(commons-rng) branch 1.6-release updated (43017372 -> 618490cf)
This is an automated email from the ASF dual-hosted git repository. aherbert pushed a change to branch 1.6-release in repository https://gitbox.apache.org/repos/asf/commons-rng.git from 43017372 Skip CPD analysis for BOM and JMH modules add 55edfb2e Drop commons-rng prefix from profiles add c37914a9 Increase robustness of the LineSampler test add 17145e85 Javadoc protected/public constructors and methods add 90300a7c Reimpliment javadoc from abstract super class add a1577117 Re-establish SNAPSHOT suffix on parent pom add 8212fcad PMD update: allow default constructors add 0490a443 Change public constructors to private add c67bdf83 Add Java 21 to the build add 8603e6d7 Update the fail/report criticality for revapi add c07a6ffc Remove duplication of jacoco report plugin from commons parent add 9aafc5dc Duplicate checkstyle excludes to the reporting configuration add 085cf2d9 Skip binary compatibility check in docs module add 9ae5b3b9 Merge branch 'master' into 1.6-release add 618490cf Release candidate No new revisions were added by this update. Summary of changes: .github/workflows/maven.yml| 8 ++-- .../org/apache/commons/rng/core/BaseProvider.java | 3 ++ .../commons/rng/core/source64/L64X128Mix.java | 6 ++- .../commons/rng/core/source64/L64X128StarStar.java | 6 ++- commons-rng-docs/pom.xml | 2 + .../commons/rng/examples/quadrature/ComputePi.java | 4 ++ .../AhrensDieterExponentialSampler.java| 2 + .../distribution/BoxMullerGaussianSampler.java | 2 + .../distribution/BoxMullerLogNormalSampler.java| 2 + .../BoxMullerNormalizedGaussianSampler.java| 2 + .../distribution/ContinuousUniformSampler.java | 2 + .../distribution/DiscreteUniformSampler.java | 2 +- .../rng/sampling/distribution/GaussianSampler.java | 2 + .../InverseTransformContinuousSampler.java | 2 + .../InverseTransformDiscreteSampler.java | 2 + .../InverseTransformParetoSampler.java | 2 + .../distribution/LargeMeanPoissonSampler.java | 2 + .../sampling/distribution/LogNormalSampler.java| 2 + .../MarsagliaNormalizedGaussianSampler.java| 2 + .../sampling/distribution/PoissonSamplerCache.java | 2 + .../RejectionInversionZipfSampler.java | 2 +- .../rng/sampling/distribution/SamplerBase.java | 10 .../distribution/SmallMeanPoissonSampler.java | 2 + .../ZigguratNormalizedGaussianSampler.java | 2 + .../rng/sampling/shape/UnitBallSampler.java| 5 ++ .../rng/sampling/shape/LineSamplerTest.java| 53 +++--- .../apache/commons/rng/simple/JDKRandomBridge.java | 4 ++ .../rng/simple/internal/ByteArray2IntArray.java| 3 ++ .../rng/simple/internal/ByteArray2LongArray.java | 3 ++ .../commons/rng/simple/internal/Int2Long.java | 3 ++ .../commons/rng/simple/internal/IntArray2Int.java | 3 ++ .../rng/simple/internal/IntArray2LongArray.java| 3 ++ .../commons/rng/simple/internal/Long2Int.java | 3 ++ .../commons/rng/simple/internal/Long2IntArray.java | 2 + .../rng/simple/internal/Long2LongArray.java| 2 + .../rng/simple/internal/LongArray2IntArray.java| 3 ++ .../rng/simple/internal/LongArray2Long.java| 3 ++ .../commons/rng/simple/internal/NoOpConverter.java | 3 ++ .../rng/simple/internal/SeedConverterComposer.java | 2 + doc/release/release.howto.txt | 12 ++--- pom.xml| 30 +++- src/changes/changes.xml| 2 +- src/conf/pmd/pmd-ruleset.xml | 4 ++ 43 files changed, 151 insertions(+), 65 deletions(-)
(commons-rng) branch master updated: Skip binary compatibility check in docs module
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 The following commit(s) were added to refs/heads/master by this push: new 085cf2d9 Skip binary compatibility check in docs module 085cf2d9 is described below commit 085cf2d96f666ca4eaa29259abf77c20a363ddd0 Author: Alex Herbert AuthorDate: Tue Jul 9 12:02:54 2024 +0100 Skip binary compatibility check in docs module There is no jar artifact to check. --- commons-rng-docs/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commons-rng-docs/pom.xml b/commons-rng-docs/pom.xml index 9e66c47c..fe8a0e4f 100644 --- a/commons-rng-docs/pom.xml +++ b/commons-rng-docs/pom.xml @@ -54,6 +54,8 @@ true true true +true +true
(commons-rng) 01/02: Remove duplication of jacoco report plugin from commons parent
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 c07a6ffcaf0fe7fdccb738d3aa545511733f821d Author: Alex Herbert AuthorDate: Mon Jul 8 16:22:56 2024 +0100 Remove duplication of jacoco report plugin from commons parent --- pom.xml | 13 - 1 file changed, 13 deletions(-) diff --git a/pom.xml b/pom.xml index 21314937..9ac3809f 100644 --- a/pom.xml +++ b/pom.xml @@ -483,19 +483,6 @@ - -org.jacoco -jacoco-maven-plugin -${commons.jacoco.version} - - - - - report - - - -
(commons-rng) 02/02: Duplicate checkstyle excludes to the reporting configuration
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 9aafc5dc828ed734a12ca007d30fdd0a9f7ffbb5 Author: Alex Herbert AuthorDate: Mon Jul 8 16:24:24 2024 +0100 Duplicate checkstyle excludes to the reporting configuration --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 9ac3809f..997333f9 100644 --- a/pom.xml +++ b/pom.xml @@ -421,6 +421,7 @@ ${rng.parent.dir}/src/conf/checkstyle/checkstyle-suppressions.xml false false + NOTICE,LICENSE,**/pom.properties,**/resolver-status.properties,**/sha512.properties
(commons-rng) branch master updated (8603e6d7 -> 9aafc5dc)
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 8603e6d7 Update the fail/report criticality for revapi new c07a6ffc Remove duplication of jacoco report plugin from commons parent new 9aafc5dc Duplicate checkstyle excludes to the reporting configuration The 2 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: pom.xml | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-)
(commons-rng) branch master updated: Update the fail/report criticality for revapi
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 The following commit(s) were added to refs/heads/master by this push: new 8603e6d7 Update the fail/report criticality for revapi 8603e6d7 is described below commit 8603e6d73757256fc18fadfe0db2a65de05aac05 Author: Alex Herbert AuthorDate: Mon Jul 8 16:16:45 2024 +0100 Update the fail/report criticality for revapi Use the defaults. --- pom.xml | 4 1 file changed, 4 deletions(-) diff --git a/pom.xml b/pom.xml index 6610ab09..21314937 100644 --- a/pom.xml +++ b/pom.xml @@ -678,10 +678,6 @@ This is avoided by creating an empty directory when svn is not available. - - equivalent - allowed
(commons-rng) 01/02: Change public constructors to private
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 0490a443d617162e1aae61defe6301535d1f58f1 Author: Alex Herbert AuthorDate: Mon Jul 8 16:01:22 2024 +0100 Change public constructors to private --- .../commons/rng/sampling/distribution/DiscreteUniformSampler.java | 2 +- .../rng/sampling/distribution/RejectionInversionZipfSampler.java| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSampler.java index 10934c0e..5bcb1b4a 100644 --- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSampler.java +++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/DiscreteUniformSampler.java @@ -342,7 +342,7 @@ public class DiscreteUniformSampler * * @param delegate Delegate. */ -public DiscreteUniformSampler(SharedStateDiscreteSampler delegate) { +private DiscreteUniformSampler(SharedStateDiscreteSampler delegate) { super(null); this.delegate = delegate; } diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSampler.java index 9cd69b6d..0aa97187 100644 --- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSampler.java +++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/RejectionInversionZipfSampler.java @@ -285,7 +285,7 @@ public class RejectionInversionZipfSampler * * @param delegate Delegate. */ -public RejectionInversionZipfSampler(SharedStateDiscreteSampler delegate) { +private RejectionInversionZipfSampler(SharedStateDiscreteSampler delegate) { super(null); this.delegate = delegate; }
(commons-rng) 02/02: Add Java 21 to the build
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 c67bdf8310f92b9310e642f49833ae29c6dd1595 Author: Alex Herbert AuthorDate: Mon Jul 8 16:02:01 2024 +0100 Add Java 21 to the build --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ad9da4ae..7e753fc6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: -java: [ 8, 11, 17 ] +java: [ 8, 11, 17, 21 ] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # 4.1.1
(commons-rng) branch master updated (8212fcad -> c67bdf83)
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 8212fcad PMD update: allow default constructors new 0490a443 Change public constructors to private new c67bdf83 Add Java 21 to the build The 2 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: .github/workflows/maven.yml | 2 +- .../commons/rng/sampling/distribution/DiscreteUniformSampler.java | 2 +- .../rng/sampling/distribution/RejectionInversionZipfSampler.java| 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
(commons-rng) branch master updated: PMD update: allow default constructors
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 The following commit(s) were added to refs/heads/master by this push: new 8212fcad PMD update: allow default constructors 8212fcad is described below commit 8212fcad5273ee09c1ce4cb40e49cc2ead3f4bf7 Author: Alex Herbert AuthorDate: Mon Jul 8 15:51:36 2024 +0100 PMD update: allow default constructors These allow building on JDK 21 without javadoc warnings. --- src/conf/pmd/pmd-ruleset.xml | 4 1 file changed, 4 insertions(+) diff --git a/src/conf/pmd/pmd-ruleset.xml b/src/conf/pmd/pmd-ruleset.xml index 1874eb25..afa7bb9b 100644 --- a/src/conf/pmd/pmd-ruleset.xml +++ b/src/conf/pmd/pmd-ruleset.xml @@ -39,6 +39,8 @@ + + @@ -47,6 +49,8 @@ + +
(commons-rng) branch master updated: Re-establish SNAPSHOT suffix on parent pom
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 The following commit(s) were added to refs/heads/master by this push: new a1577117 Re-establish SNAPSHOT suffix on parent pom a1577117 is described below commit a1577117db463a87be4422832f2fd1dd6e1f7f69 Author: Alex Herbert AuthorDate: Mon Jul 8 15:41:32 2024 +0100 Re-establish SNAPSHOT suffix on parent pom The SNAPSHOT suffix and build outputTimestamp were locally updated to match the 1.6-release branch (reasons unknown). --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a48c1588..6610ab09 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ commons-rng-parent - 1.6 + 1.6-SNAPSHOT pom Apache Commons RNG The Apache Commons RNG project provides pure-Java implementation of pseudo-random generators. @@ -44,7 +44,7 @@ false -2024-07-05T00:00:00Z +2024-04-18T00:00:00Z ${rng.build.outputTimestamp} 1.6
(commons-rng) 04/04: Reimpliment javadoc from abstract super class
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 90300a7c13194f78a10ad5ecb6232bc806cb040a Author: Alex Herbert AuthorDate: Mon Jul 8 15:28:52 2024 +0100 Reimpliment javadoc from abstract super class Added to avoid warnings when building on Java 21 (which fail the build). JDK 21 expects the {@inheritDoc} to be used with a method with the same scopy. Here the scope is changed to protected. --- .../main/java/org/apache/commons/rng/core/source64/L64X128Mix.java | 6 +- .../java/org/apache/commons/rng/core/source64/L64X128StarStar.java | 6 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/L64X128Mix.java b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/L64X128Mix.java index 2ca27d23..ead06c21 100644 --- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/L64X128Mix.java +++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/L64X128Mix.java @@ -129,7 +129,11 @@ public class L64X128Mix extends AbstractL64X128 implements SplittableUniformRand return z; } -/** {@inheritDoc} */ +/** + * Create a copy. + * + * @return the copy + */ @Override protected L64X128Mix copy() { // This exists to ensure the jump function performed in the super class returns diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/L64X128StarStar.java b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/L64X128StarStar.java index dc56fa2d..f22614fd 100644 --- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/L64X128StarStar.java +++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/L64X128StarStar.java @@ -121,7 +121,11 @@ public class L64X128StarStar extends AbstractL64X128 implements SplittableUnifor return z; } -/** {@inheritDoc} */ +/** + * Create a copy. + * + * @return the copy + */ @Override protected L64X128StarStar copy() { // This exists to ensure the jump function performed in the super class returns
(commons-rng) 02/04: Increase robustness of the LineSampler test
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 c37914a9309a0944976237393f0bcc6b945af69c Author: Alex Herbert AuthorDate: Mon Jul 8 14:58:23 2024 +0100 Increase robustness of the LineSampler test Sporadic failures have been observed for the assertion than the point is on the line. The test now inverts the point location to a uniform value in [0, 1) and asserts it matches the output from the RNG. This removes the requirement for a Chi-square test as the RNG output should be uniform. --- .../rng/sampling/shape/LineSamplerTest.java| 53 +++--- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java index 4713681f..b9241251 100644 --- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java +++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/shape/LineSamplerTest.java @@ -17,7 +17,7 @@ package org.apache.commons.rng.sampling.shape; import java.util.Arrays; -import org.apache.commons.math3.stat.inference.ChiSquareTest; +import java.util.stream.DoubleStream; import org.apache.commons.rng.UniformRandomProvider; import org.apache.commons.rng.sampling.RandomAssert; import org.apache.commons.rng.sampling.UnitSphereSampler; @@ -225,34 +225,33 @@ class LineSamplerTest { scale[i] = 1.0 / (b[i] - a[i]); } -// Assign bins -final int bins = 100; -final int samplesPerBin = 20; - -// Expect a uniform distribution -final double[] expected = new double[bins]; -Arrays.fill(expected, 1.0 / bins); - -// Increase the loops and use a null seed (i.e. randomly generated) to verify robustness -final LineSampler sampler = LineSampler.of(rng, a, b); -final int samples = expected.length * samplesPerBin; -for (int n = 0; n < 1; n++) { -// Assign each coordinate to a region inside the line -final long[] observed = new long[expected.length]; -for (int i = 0; i < samples; i++) { -final double[] x = sampler.sample(); -Assertions.assertEquals(dimension, x.length); -final double c = (x[0] - a[0]) * scale[0]; -Assertions.assertTrue(c >= 0.0 && c <= 1.0, "Not uniformly distributed"); -for (int j = 1; j < dimension; j++) { -Assertions.assertEquals(c, (x[j] - a[j]) * scale[j], 1e-14, "Not on the line"); -} -// Assign the uniform deviate to a bin. Assumes c != 1.0. -observed[(int) (c * bins)]++; +// Use two RNGs with the same output. The line sampler only uses a single double +// per sample so we can assert that the point is approximately located along the +// line vector is each dimension by the constant C. Floating-point tolerance +// is required to validate the equality. +final UniformRandomProvider[] rngs = RandomAssert.createRNG(2); +final UniformRandomProvider rng1 = rngs[0]; +final UniformRandomProvider rng2 = rngs[1]; +final LineSampler sampler = LineSampler.of(rng1, a, b); +final double relEps = 1e-10; +final int n = 1000; +final DoubleStream.Builder errors = DoubleStream.builder(); +for (int i = 0; i < n; i++) { +final double[] x = sampler.sample(); +Assertions.assertEquals(dimension, x.length); +final double c = rng2.nextDouble(); +for (int j = 0; j < dimension; j++) { +final double u = (x[j] - a[j]) * scale[j]; +Assertions.assertTrue(u >= 0.0 && u <= 1.0, "Not within the line"); +final double e = Math.abs(c - u) / u; +errors.add(e); +Assertions.assertEquals(c, u, c * relEps, +() -> "Not on the expected line: rel.error = " + e); } -final double p = new ChiSquareTest().chiSquareTest(expected, observed); -Assertions.assertFalse(p < 0.001, () -> "p-value too small: " + p); } +final double averageRelError = errors.build().sum() / n; +Assertions.assertTrue(averageRelError < 1e-12, +() -> "Average relative error is too large = " + averageRelError); } /**
(commons-rng) 03/04: Javadoc protected/public constructors and methods
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 17145e85e283d37d97c3f330a8f52380555bca52 Author: Alex Herbert AuthorDate: Mon Jul 8 15:17:20 2024 +0100 Javadoc protected/public constructors and methods Added to avoid warnings when building on Java 21 (which fail the build). This requires adding implicit public constructors. --- .../main/java/org/apache/commons/rng/core/BaseProvider.java| 3 +++ .../org/apache/commons/rng/examples/quadrature/ComputePi.java | 4 .../sampling/distribution/AhrensDieterExponentialSampler.java | 2 ++ .../rng/sampling/distribution/BoxMullerGaussianSampler.java| 2 ++ .../rng/sampling/distribution/BoxMullerLogNormalSampler.java | 2 ++ .../distribution/BoxMullerNormalizedGaussianSampler.java | 2 ++ .../rng/sampling/distribution/ContinuousUniformSampler.java| 2 ++ .../commons/rng/sampling/distribution/GaussianSampler.java | 2 ++ .../distribution/InverseTransformContinuousSampler.java| 2 ++ .../sampling/distribution/InverseTransformDiscreteSampler.java | 2 ++ .../sampling/distribution/InverseTransformParetoSampler.java | 2 ++ .../rng/sampling/distribution/LargeMeanPoissonSampler.java | 2 ++ .../commons/rng/sampling/distribution/LogNormalSampler.java| 2 ++ .../distribution/MarsagliaNormalizedGaussianSampler.java | 2 ++ .../commons/rng/sampling/distribution/PoissonSamplerCache.java | 2 ++ .../apache/commons/rng/sampling/distribution/SamplerBase.java | 10 ++ .../rng/sampling/distribution/SmallMeanPoissonSampler.java | 2 ++ .../distribution/ZigguratNormalizedGaussianSampler.java| 2 ++ .../org/apache/commons/rng/sampling/shape/UnitBallSampler.java | 5 + .../java/org/apache/commons/rng/simple/JDKRandomBridge.java| 4 .../apache/commons/rng/simple/internal/ByteArray2IntArray.java | 3 +++ .../commons/rng/simple/internal/ByteArray2LongArray.java | 3 +++ .../java/org/apache/commons/rng/simple/internal/Int2Long.java | 3 +++ .../org/apache/commons/rng/simple/internal/IntArray2Int.java | 3 +++ .../apache/commons/rng/simple/internal/IntArray2LongArray.java | 3 +++ .../java/org/apache/commons/rng/simple/internal/Long2Int.java | 3 +++ .../org/apache/commons/rng/simple/internal/Long2IntArray.java | 2 ++ .../org/apache/commons/rng/simple/internal/Long2LongArray.java | 2 ++ .../apache/commons/rng/simple/internal/LongArray2IntArray.java | 3 +++ .../org/apache/commons/rng/simple/internal/LongArray2Long.java | 3 +++ .../org/apache/commons/rng/simple/internal/NoOpConverter.java | 3 +++ .../commons/rng/simple/internal/SeedConverterComposer.java | 2 ++ 32 files changed, 89 insertions(+) diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/BaseProvider.java b/commons-rng-core/src/main/java/org/apache/commons/rng/core/BaseProvider.java index 5bf39309..30f9cbf1 100644 --- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/BaseProvider.java +++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/BaseProvider.java @@ -37,6 +37,9 @@ public abstract class BaseProvider /** The fractional part of the golden ratio, phi, scaled to 32-bits and rounded to odd. */ private static final int GOLDEN_RATIO_32 = 0x9e3779b9; +/** Create an instance. */ +public BaseProvider() {} + /** {@inheritDoc} */ @Override public RandomProviderState saveState() { 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 829895f2..bb0d6e9d 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 @@ -40,6 +40,8 @@ public class ComputePi extends MonteCarloIntegration { private static final int DIMENSION = 2; /** + * Create an instance. + * * @param rng RNG. */ public ComputePi(UniformRandomProvider rng) { @@ -78,6 +80,8 @@ public class ComputePi extends MonteCarloIntegration { } /** + * Compute the value of pi. + * * @param numPoints Number of random points to generate. * @return the approximate value of pi. */ diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/AhrensDieterExponentialSampler.java index 86fac42a..203ebbb4 100644 --- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution
(commons-rng) 01/04: Drop commons-rng prefix from profiles
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 55edfb2e5e0c52ad488f8aecd15c54aca9d25724 Author: Alex Herbert AuthorDate: Mon Jul 8 14:08:51 2024 +0100 Drop commons-rng prefix from profiles --- .github/workflows/maven.yml | 6 +++--- doc/release/release.howto.txt | 12 ++-- pom.xml | 12 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index de0e227a..ad9da4ae 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -50,6 +50,6 @@ jobs: # Run the OSGi integration test for the installed modules. if: matrix.java > 8 run: | -mvn --show-version --batch-mode --no-transfer-progress -P commons-rng-examples clean install -Dmaven.javadoc.skip -mvn --show-version --batch-mode --no-transfer-progress -P commons-rng-examples javadoc:javadoc -mvn --show-version --batch-mode --no-transfer-progress -P commons-rng-integration -pl commons-rng-integration clean package integration-test +mvn --show-version --batch-mode --no-transfer-progress -P examples clean install -Dmaven.javadoc.skip +mvn --show-version --batch-mode --no-transfer-progress -P examples javadoc:javadoc +mvn --show-version --batch-mode --no-transfer-progress -P integration -pl commons-rng-integration clean package integration-test diff --git a/doc/release/release.howto.txt b/doc/release/release.howto.txt index 8da2d076..24b8717c 100644 --- a/doc/release/release.howto.txt +++ b/doc/release/release.howto.txt @@ -152,7 +152,7 @@ that the build process can create all the necessary artifacts. (1b) The command (requires Java 11): -$ JAVA_HOME="__Path_to_a_JDK__" mvn -Pcommons-rng-examples package site site:stage +$ JAVA_HOME="__Path_to_a_JDK__" mvn -Pexamples package site site:stage should create the site in the "target/staging" directory. The JPMS example modules require Java 11. @@ -246,7 +246,7 @@ In particular: The "download" page template is located at "src/site/xdoc/download_rng.xml". This file is updated automatically by running the command: - $ mvn -N -Pcommons-rng-examples commons-build:download-page + $ mvn -N -Pexamples commons-build:download-page Note: This command presently requires Java 8. @@ -256,7 +256,7 @@ collected during development in the file "src/changes/changes.xml". Create it by running: - $ mvn -Prelease-notes -Pcommons-rng-examples changes:announcement-generate + $ mvn -Prelease-notes -Pexamples changes:announcement-generate Ensure the formatting of the RELEASE-NOTES.txt is consistent. Compare the main header description to the previous release notes in src/site/resources/release-notes/ @@ -565,7 +565,7 @@ Then run these commands: correct hashes. It also removes the previous javadocs package-list generated using Java 8. - $ mvn -Pcommons-rng-examples package site site:stage + $ mvn -Pexamples package site site:stage $ cd target $ mv staging commons-rng-1.5-RC1-site @@ -643,7 +643,7 @@ Java version: 1.8.0_241, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk1. Default locale: en_GB, platform encoding: UTF-8 OS name: "linux", version: "4.15.0-153-generic", arch: "amd64", family: "unix" -I have tested this with 'mvn clean package site site:stage -Pcommons-rng-examples' using: +I have tested this with 'mvn clean package site site:stage -Pexamples' using: Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /usr/local/apache-maven-3.6.3 @@ -943,7 +943,7 @@ next version will be 1.6). This can be done using maven: -$ mvn release:update-versions -DautoVersionSubmodules=true -Prelease -Pcommons-rng-examples +$ mvn release:update-versions -DautoVersionSubmodules=true -Prelease -Pexamples You will only be prompted for the desired version number once. This may miss the dist-archive/pom.xml for all diff --git a/pom.xml b/pom.xml index 34f9ec1f..a48c1588 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ commons-rng-parent - 1.6-SNAPSHOT + 1.6 pom Apache Commons RNG The Apache Commons RNG project provides pure-Java implementation of pseudo-random generators. @@ -44,7 +44,7 @@ false -2024-04-18T00:00:00Z +2024-07-05T00:00:00Z ${rng.build.outputTimestamp} 1.6 @@ -106,7 +106,7 @@ commons-rng-docs @@ -700,14 +700,14 @@ This is avoided by creating an empty directory when svn is not available. These are combined with the existing . --> - commons-rng-examples + examples commons-rng-examples - commons-rng-integrati
(commons-rng) branch master updated (7267fb93 -> 90300a7c)
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 7267fb93 Do not export the internal module new 55edfb2e Drop commons-rng prefix from profiles new c37914a9 Increase robustness of the LineSampler test new 17145e85 Javadoc protected/public constructors and methods new 90300a7c Reimpliment javadoc from abstract super class The 4 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: .github/workflows/maven.yml| 6 +-- .../org/apache/commons/rng/core/BaseProvider.java | 3 ++ .../commons/rng/core/source64/L64X128Mix.java | 6 ++- .../commons/rng/core/source64/L64X128StarStar.java | 6 ++- .../commons/rng/examples/quadrature/ComputePi.java | 4 ++ .../AhrensDieterExponentialSampler.java| 2 + .../distribution/BoxMullerGaussianSampler.java | 2 + .../distribution/BoxMullerLogNormalSampler.java| 2 + .../BoxMullerNormalizedGaussianSampler.java| 2 + .../distribution/ContinuousUniformSampler.java | 2 + .../rng/sampling/distribution/GaussianSampler.java | 2 + .../InverseTransformContinuousSampler.java | 2 + .../InverseTransformDiscreteSampler.java | 2 + .../InverseTransformParetoSampler.java | 2 + .../distribution/LargeMeanPoissonSampler.java | 2 + .../sampling/distribution/LogNormalSampler.java| 2 + .../MarsagliaNormalizedGaussianSampler.java| 2 + .../sampling/distribution/PoissonSamplerCache.java | 2 + .../rng/sampling/distribution/SamplerBase.java | 10 .../distribution/SmallMeanPoissonSampler.java | 2 + .../ZigguratNormalizedGaussianSampler.java | 2 + .../rng/sampling/shape/UnitBallSampler.java| 5 ++ .../rng/sampling/shape/LineSamplerTest.java| 53 +++--- .../apache/commons/rng/simple/JDKRandomBridge.java | 4 ++ .../rng/simple/internal/ByteArray2IntArray.java| 3 ++ .../rng/simple/internal/ByteArray2LongArray.java | 3 ++ .../commons/rng/simple/internal/Int2Long.java | 3 ++ .../commons/rng/simple/internal/IntArray2Int.java | 3 ++ .../rng/simple/internal/IntArray2LongArray.java| 3 ++ .../commons/rng/simple/internal/Long2Int.java | 3 ++ .../commons/rng/simple/internal/Long2IntArray.java | 2 + .../rng/simple/internal/Long2LongArray.java| 2 + .../rng/simple/internal/LongArray2IntArray.java| 3 ++ .../rng/simple/internal/LongArray2Long.java| 3 ++ .../commons/rng/simple/internal/NoOpConverter.java | 3 ++ .../rng/simple/internal/SeedConverterComposer.java | 2 + doc/release/release.howto.txt | 12 ++--- pom.xml| 12 ++--- 38 files changed, 140 insertions(+), 44 deletions(-)
(commons-numbers) branch master updated: Update profile name in referencing documents
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-numbers.git The following commit(s) were added to refs/heads/master by this push: new cc0d4d02 Update profile name in referencing documents cc0d4d02 is described below commit cc0d4d0235951a47b500f3a7a5edbcdda2195b4a Author: Alex Herbert AuthorDate: Mon Jul 8 14:02:15 2024 +0100 Update profile name in referencing documents --- .github/workflows/maven.yml | 4 ++-- doc/release/release.howto.txt | 10 +- pom.xml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 3c8531c8..661e1e87 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -65,5 +65,5 @@ jobs: # Here we run the build and javadoc generation separately (which requires install of sources) if: matrix.java > 8 run: | -mvn --show-version --batch-mode --no-transfer-progress -P commons-numbers-examples clean install -Dmaven.javadoc.skip -mvn --show-version --batch-mode --no-transfer-progress -P commons-numbers-examples javadoc:javadoc -Dmaven.javadoc.skip=false +mvn --show-version --batch-mode --no-transfer-progress -P examples clean install -Dmaven.javadoc.skip +mvn --show-version --batch-mode --no-transfer-progress -P examples javadoc:javadoc -Dmaven.javadoc.skip=false diff --git a/doc/release/release.howto.txt b/doc/release/release.howto.txt index 6bcc7441..d240bfc8 100644 --- a/doc/release/release.howto.txt +++ b/doc/release/release.howto.txt @@ -152,7 +152,7 @@ that the build process can create all the necessary artifacts. (1b) The command (requires Java 11): -$ JAVA_HOME="__Path_to_a_JDK__" mvn -Pcommons-numbers-examples package site site:stage +$ JAVA_HOME="__Path_to_a_JDK__" mvn -Pexamples package site site:stage should create the site in the "target/staging" directory. The JMH example modules require Java 9+. @@ -221,7 +221,7 @@ In particular: This can be done using maven: -$ mvn versions:set -DnewVersion=1.1 -DgenerateBackupPoms=false -Pcommons-numbers-examples +$ mvn versions:set -DnewVersion=1.1 -DgenerateBackupPoms=false -Pexamples You may need to update the version in dist-archive/pom.xml manually. @@ -564,7 +564,7 @@ Then run these commands: correct hashes. It also removes the previous javadocs package-list generated using Java 8. - $ mvn -Pcommons-numbers-examples package site site:stage + $ mvn -Pexamples package site site:stage $ cd target $ mv staging commons-numbers-1.1-RC1-site @@ -627,7 +627,7 @@ I have tested this with 'mvn clean install' using: *** -I have tested this with 'mvn clean install site site:stage -Pcommons-numbers-examples' using: +I have tested this with 'mvn clean install site site:stage -Pexamples' using: *** @@ -898,7 +898,7 @@ next version will be 1.2). This can be done using maven: -$ mvn release:update-versions -DautoVersionSubmodules=true -Prelease -Pcommons-numbers-examples +$ mvn release:update-versions -DautoVersionSubmodules=true -Prelease -Pexamples You will only be prompted for the desired version number once. This may miss the dist-archive/pom.xml for all the dependencies. diff --git a/pom.xml b/pom.xml index af987817..fc7c8be7 100644 --- a/pom.xml +++ b/pom.xml @@ -627,7 +627,7 @@ This is avoided by creating an empty directory when svn is not available. release + Use the examples profile to create the site. --> dist-archive
(commons-numbers) branch master updated: Rename profile commons-numbers-examples to example
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-numbers.git The following commit(s) were added to refs/heads/master by this push: new 88edbf78 Rename profile commons-numbers-examples to example 88edbf78 is described below commit 88edbf78a9f0600647504d01d17a5387d475fe3a Author: Alex Herbert AuthorDate: Mon Jul 8 13:53:11 2024 +0100 Rename profile commons-numbers-examples to example --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ae284632..af987817 100644 --- a/pom.xml +++ b/pom.xml @@ -617,7 +617,7 @@ This is avoided by creating an empty directory when svn is not available. These are combined with the existing . --> - commons-numbers-examples + examples commons-numbers-examples
(commons-statistics) branch master updated: Remove TODO comment to simplify test
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-statistics.git The following commit(s) were added to refs/heads/master by this push: new 0168b9f Remove TODO comment to simplify test 0168b9f is described below commit 0168b9f4a08768c13778039277d41d2b8410284c Author: Alex Herbert AuthorDate: Mon Jul 8 13:51:00 2024 +0100 Remove TODO comment to simplify test Added additional comments to clarify the current ranking-by-group test. --- .../statistics/ranking/NaturalRankingTest.java | 48 +- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/commons-statistics-ranking/src/test/java/org/apache/commons/statistics/ranking/NaturalRankingTest.java b/commons-statistics-ranking/src/test/java/org/apache/commons/statistics/ranking/NaturalRankingTest.java index 9bc717f..00e8e3e 100644 --- a/commons-statistics-ranking/src/test/java/org/apache/commons/statistics/ranking/NaturalRankingTest.java +++ b/commons-statistics-ranking/src/test/java/org/apache/commons/statistics/ranking/NaturalRankingTest.java @@ -259,12 +259,12 @@ class NaturalRankingTest { @MethodSource void testRanksTiesRandom(RankingAlgorithm ranking, int[] example, int[] tiesFirst, int[] tiesLast, int[] multipleNaNs, int[] multipleTies, int[] allSame) { -assertRanks(ranking, EXAMPLE_DATA, example, "Example data"); -assertRanks(ranking, TIES_FIRST, tiesFirst, "Ties first"); -assertRanks(ranking, TIES_LAST, tiesLast, "Ties last"); -assertRanks(ranking, MULTIPLE_NANS, multipleNaNs, "Multiple NaNs"); -assertRanks(ranking, MULTIPLE_TIES, multipleTies, "Multiple ties"); -assertRanks(ranking, ALL_SAME, allSame, "All same"); +assertRanksByGroup(ranking, EXAMPLE_DATA, example, "Example data"); +assertRanksByGroup(ranking, TIES_FIRST, tiesFirst, "Ties first"); +assertRanksByGroup(ranking, TIES_LAST, tiesLast, "Ties last"); +assertRanksByGroup(ranking, MULTIPLE_NANS, multipleNaNs, "Multiple NaNs"); +assertRanksByGroup(ranking, MULTIPLE_TIES, multipleTies, "Multiple ties"); +assertRanksByGroup(ranking, ALL_SAME, allSame, "All same"); } /** @@ -506,24 +506,29 @@ class NaturalRankingTest { * through the algorithm and the result must be unchanged thus ensuring the * algorithm is stable. * + * This asserts that the output ranks are sequential from 1. + * * Groups must use a sequential ordering from 1. * Any negative expected group marks data to be removed (e.g. NaNs). * Any group of zero marks data to be left unchanged (e.g. NaNs). * Note that the current test assumes the removed and unchanged options are mutually exclusive. - * Groups are mapped to an expected rank using a sequential ordering from 1. - * The order within a group can be random. * - * For example: + * Groups are mapped to an expected rank using a sequential ordering from 1. + * The order within a group can be random, but all members of the same group must + * have a set of continuous integer ranks. + * + * For example: * * groups: [1, 2, 2, 2, 3] * + * ranking: * [1, 2, 3, 4, 5] : pass * [1, 4, 3, 2, 5] : pass * [1, 2, 4, 3, 5] : pass - * [1, 3, 3, 3, 5] : fail - * [1, 2, 2, 4, 5] : fail - * [1, 2, 3, 4, 4] : fail - * [1, 2, 3, 4, 6] : fail + * [1, 3, 3, 3, 5] : fail - ranking is not sequential from 1 + * [1, 2, 3, 5, 4] : fail - item [3] and [4] do not match the groups + * [2, 1, 3, 4, 5] : fail - item [0] and [4] do not match the groups + * [1, 2, 3, 4, 6] : fail - ranking is not sequential from 1 * * * @param ranking Ranking algorithm @@ -531,7 +536,7 @@ class NaturalRankingTest { * @param expectedGroups Expected groups (if null the algorithm is expected to raise an {@link IllegalArgumentException}) * @param msg Prefix for any assertion failure message */ -private static void assertRanks(RankingAlgorithm ranking, double[] data, int[] expectedGroups, String msg) { +private static void assertRanksByGroup(RankingAlgorithm ranking, double[] data, int[] expectedGroups, String msg) { if (expectedGroups == null) { Assertions.assertThrows(IllegalArgumentException.class, () -> ranking.apply(data)); } else { @@ -543,8 +548,6 @@ class NaturalRankingTest { final double[] ranks2 = ranking.apply(ranks); Assertions.assertArrayEquals(ranks, ranks2, () -> msg + ": Repeat ranking changed the result"); -// TODO: Simplify the collation of groups into sets. -
(commons-numbers) branch master updated (1c1b8069 -> 8ad59563)
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-numbers.git from 1c1b8069 Update exec-maven-plugin 3.0.0 -> 3.3.0 new 5e81b1ed Fix PMD ShortMethodName exclusions new 37ccf9d1 Cleanup unused and obsolete methods test methods new 1351b74d Drop TODO comment new fd81e017 Drop TODO for additional Complex edge cases new a005a24f Remove TODO about testing the key analysis method new f5f135d2 Reinstate test of polar form new 8ad59563 Reinstate quaternion multiplication tests The 7 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: .../numbers/complex/ComplexEdgeCaseTest.java | 3 - .../apache/commons/numbers/complex/TestUtils.java | 226 + .../numbers/examples/jmh/arrays/KthSelector.java | 2 - .../numbers/examples/jmh/arrays/PartitionTest.java | 1 - .../examples/jmh/arrays/PivotCacheTest.java| 3 - .../commons/numbers/quaternion/QuaternionTest.java | 118 +++ src/conf/pmd/pmd-ruleset.xml | 6 +- 7 files changed, 33 insertions(+), 326 deletions(-)
(commons-numbers) 04/07: Drop TODO for additional Complex edge cases
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-numbers.git commit fd81e017f42059576d0d032d49fba4a80e61f811 Author: Alex Herbert AuthorDate: Mon Jul 8 11:44:04 2024 +0100 Drop TODO for additional Complex edge cases The edge cases for pow are not defined for extreme values (MAX_VALUE, MIN_VALUE), thus comparison to other implementations is arbitrary. --- .../java/org/apache/commons/numbers/complex/ComplexEdgeCaseTest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexEdgeCaseTest.java b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexEdgeCaseTest.java index 95a39520..9055ac48 100644 --- a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexEdgeCaseTest.java +++ b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexEdgeCaseTest.java @@ -686,9 +686,6 @@ class ComplexEdgeCaseTest { // pow(Complex) is log().multiply(Complex).exp() // All are overflow safe and handle infinities as defined in the C99 standard. -// TODO: Test edge cases with: -// Double.MAX_VALUE, Double.MIN_NORMAL, Inf -// using other library implementations. // Test NaN assertComplex(1, 1, nan, nan, name, operation, nan, nan);
(commons-numbers) 03/07: Drop TODO comment
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-numbers.git commit 1351b74dd937c381dd1113f1908afae394554563 Author: Alex Herbert AuthorDate: Mon Jul 8 11:40:31 2024 +0100 Drop TODO comment Leave the source unchanged as it matches the reference implementation. --- .../org/apache/commons/numbers/examples/jmh/arrays/KthSelector.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/arrays/KthSelector.java b/commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/arrays/KthSelector.java index ef7ab5f5..d9652052 100644 --- a/commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/arrays/KthSelector.java +++ b/commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/arrays/KthSelector.java @@ -1666,8 +1666,6 @@ class KthSelector { // values closer to the edge. The middle will be sorted by quicksort. // 13 = 27 / 2 where 27 is the threshold for quicksort. if (dist < (minSelectSize >>> 1)) { -// TODO: Determine if this is needed? The original paper -// does not comment its purpose. div++; } //swap(a, less - 1, left)
(commons-numbers) 06/07: Reinstate test of polar form
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-numbers.git commit f5f135d20b758eada18ab281c37db364c26a0bf5 Author: Alex Herbert AuthorDate: Mon Jul 8 11:58:24 2024 +0100 Reinstate test of polar form --- .../commons/numbers/quaternion/QuaternionTest.java | 27 +- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java b/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java index 92f835c3..a1512be8 100644 --- a/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java +++ b/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java @@ -17,7 +17,7 @@ package org.apache.commons.numbers.quaternion; import java.util.Random; - +import java.util.SplittableRandom; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -551,35 +551,20 @@ class QuaternionTest { Assertions.assertTrue(q.equals(qNeg.negate(), 0d)); } -/* TODO remove dependency on Rotation @Test final void testPolarForm() { -final Random r = new Random(48); +final SplittableRandom r = new SplittableRandom(48); final int numberOfTrials = 1000; for (int i = 0; i < numberOfTrials; i++) { final Quaternion q = Quaternion.of(2 * (r.nextDouble() - 0.5), 2 * (r.nextDouble() - 0.5), -2 * (r.nextDouble() - 0.5), 2 * (r.nextDouble() - 0.5)); + 2 * (r.nextDouble() - 0.5), 2 * (r.nextDouble() - 0.5)); final Quaternion qP = q.positivePolarForm(); -Assert.assertTrue(qP.isUnit(COMPARISON_EPS)); -Assert.assertTrue(qP.getW() >= 0); - -final Rotation rot = new Rotation(q.getW(), q.getX(), q.getY(), q.getZ(), true); -final Rotation rotP = new Rotation(qP.getW(), qP.getX(), qP.getY(), qP.getZ(), true); - -Assert.assertEquals(rot.getAngle(), rotP.getAngle(), COMPARISON_EPS); - Assert.assertEquals(rot.getAxis(RotationConvention.VECTOR_OPERATOR).getX(), - rot.getAxis(RotationConvention.VECTOR_OPERATOR).getX(), -COMPARISON_EPS); - Assert.assertEquals(rot.getAxis(RotationConvention.VECTOR_OPERATOR).getY(), - rot.getAxis(RotationConvention.VECTOR_OPERATOR).getY(), -COMPARISON_EPS); - Assert.assertEquals(rot.getAxis(RotationConvention.VECTOR_OPERATOR).getZ(), - rot.getAxis(RotationConvention.VECTOR_OPERATOR).getZ(), -COMPARISON_EPS); +Assertions.assertTrue(qP.isUnit(COMPARISON_EPS), "polar form is not unit length"); +Assertions.assertTrue(qP.getW() >= 0, "scalar part is not positive"); } } -*/ + @Test final void testInverse() { final Quaternion q = Quaternion.of(1.5, 4, 2, -2.5);
(commons-numbers) 02/07: Cleanup unused and obsolete methods test methods
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-numbers.git commit 37ccf9d1d74853d387a7ed2a921a1a90c3f9dc00 Author: Alex Herbert AuthorDate: Mon Jul 8 11:39:10 2024 +0100 Cleanup unused and obsolete methods test methods --- .../apache/commons/numbers/complex/TestUtils.java | 226 + 1 file changed, 1 insertion(+), 225 deletions(-) diff --git a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/TestUtils.java b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/TestUtils.java index 428b7705..ff97d6c3 100644 --- a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/TestUtils.java +++ b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/TestUtils.java @@ -18,22 +18,15 @@ package org.apache.commons.numbers.complex; import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStreamReader; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; - -import org.apache.commons.numbers.core.Precision; - import org.junit.jupiter.api.Assertions; /** - * Test utilities. TODO: Cleanup (remove unused and obsolete methods). + * Test utilities. */ public final class TestUtils { @@ -80,223 +73,6 @@ public final class TestUtils { Assertions.assertEquals(expected.getImaginary(), actual.getImaginary(), delta); } -/** - * Serializes an object to a bytes array and then recovers the object from the - * bytes array. Returns the deserialized object. - * - * @param o object to serialize and recover - * @return the recovered, deserialized object - */ -public static Object serializeAndRecover(Object o) { -try { -// serialize the Object -final ByteArrayOutputStream bos = new ByteArrayOutputStream(); -final ObjectOutputStream so = new ObjectOutputStream(bos); -so.writeObject(o); - -// deserialize the Object -final ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); -final ObjectInputStream si = new ObjectInputStream(bis); -return si.readObject(); -} catch (final IOException ioe) { -return null; -} catch (final ClassNotFoundException cnfe) { -return null; -} -} - -/** - * Verifies that serialization preserves equals and hashCode. Serializes the - * object, then recovers it and checks equals and hash code. - * - * @param object the object to serialize and recover - */ -public static void checkSerializedEquality(Object object) { -final Object object2 = serializeAndRecover(object); -Assertions.assertEquals(object, object2, "Equals check"); -Assertions.assertEquals(object.hashCode(), object2.hashCode(), "HashCode check"); -} - -/** - * Verifies that the relative error in actual vs. expected is less than or equal - * to relativeError. If expected is infinite or NaN, actual must be the same - * (NaN or infinity of the same sign). - * - * @param expected expected value - * @param actual observed value - * @param relativeError maximum allowable relative error - */ -public static void assertRelativelyEquals(double expected, double actual, double relativeError) { -assertRelativelyEquals(null, expected, actual, relativeError); -} - -/** - * Verifies that the relative error in actual vs. expected is less than or equal - * to relativeError. If expected is infinite or NaN, actual must be the same - * (NaN or infinity of the same sign). - * - * @param msg message to return with failure - * @param expected expected value - * @param actual observed value - * @param relativeError maximum allowable relative error - */ -public static void assertRelativelyEquals(String msg, double expected, double actual, double relativeError) { -if (Double.isNaN(expected)) { -Assertions.assertTrue(Double.isNaN(actual), msg); -} else if (Double.isNaN(actual)) { -Assertions.assertTrue(Double.isNaN(expected), msg); -} else if (Double.isInfinite(actual) || Double.isInfinite(expected)) { -Assertions.assertEquals(expected, actual, relativeError); -} else if (expected == 0.0) { -Assertions.assertEquals(actual, expected, relativeError, msg); -} else { -final double absError = Math.abs(expected) * relativeError; -Assertions.assertEquals(expected, actual, absError, msg); -} -} - -/** - * Fails iff val
(commons-numbers) 07/07: Reinstate quaternion multiplication tests
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-numbers.git commit 8ad59563ecbdc6986330c25c3e5b7a54e5b61564 Author: Alex Herbert AuthorDate: Mon Jul 8 12:14:58 2024 +0100 Reinstate quaternion multiplication tests Drop test using the vector equivalent multiplication. This duplicates validation that the result is correct. --- .../commons/numbers/quaternion/QuaternionTest.java | 91 ++ 1 file changed, 22 insertions(+), 69 deletions(-) diff --git a/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java b/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java index a1512be8..690d0b82 100644 --- a/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java +++ b/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java @@ -118,9 +118,8 @@ class QuaternionTest { Assertions.assertEquals(-q3, qConjugate.getZ()); } -/* TODO remove dependency on Vector3D @Test -final void testProductQuaternionQuaternion() { +final void testMultiplyQuaternionQuaternion() { // Case : analytic test case @@ -128,44 +127,25 @@ class QuaternionTest { final Quaternion qB = Quaternion.of(6, 2, 1, -9); final Quaternion qResult = Quaternion.multiply(qA, qB); -Assert.assertEquals(44, qResult.getW(), EPS); -Assert.assertEquals(28, qResult.getX(), EPS); -Assert.assertEquals(-4.5, qResult.getY(), EPS); -Assert.assertEquals(21.5, qResult.getZ(), EPS); - -// comparison with the result given by the formula : -// qResult = (scalarA * scalarB - vectorA . vectorB) + (scalarA * vectorB + scalarB * vectorA + vectorA ^ -// vectorB) - -final Vector3D vectorA = new Vector3D(qA.getVectorPart()); -final Vector3D vectorB = new Vector3D(qB.getVectorPart()); -final Vector3D vectorResult = new Vector3D(qResult.getVectorPart()); - -final double scalarPartRef = qA.getScalarPart() * qB.getScalarPart() - Vector3D.dotProduct(vectorA, vectorB); - -Assert.assertEquals(scalarPartRef, qResult.getScalarPart(), EPS); - -final Vector3D vectorPartRef = ((vectorA.scalarMultiply(qB.getScalarPart())).add(vectorB.scalarMultiply(qA -.getScalarPart(.add(Vector3D.crossProduct(vectorA, vectorB)); -final double norm = (vectorResult.subtract(vectorPartRef)).norm(); - -Assert.assertEquals(0, norm, EPS); +Assertions.assertEquals(44, qResult.getW(), EPS); +Assertions.assertEquals(28, qResult.getX(), EPS); +Assertions.assertEquals(-4.5, qResult.getY(), EPS); +Assertions.assertEquals(21.5, qResult.getZ(), EPS); // Conjugate of the product of two quaternions and product of their conjugates : // Conj(qA * qB) = Conj(qB) * Conj(qA) -final Quaternion conjugateOfProduct = qB.getConjugate().multiply(qA.getConjugate()); -final Quaternion productOfConjugate = (qA.multiply(qB)).getConjugate(); +final Quaternion productOfConjugate = qB.conjugate().multiply(qA.conjugate()); +final Quaternion conjugateOfProduct = (qA.multiply(qB)).conjugate(); -Assert.assertEquals(conjugateOfProduct.getW(), productOfConjugate.getW(), EPS); -Assert.assertEquals(conjugateOfProduct.getX(), productOfConjugate.getX(), EPS); -Assert.assertEquals(conjugateOfProduct.getY(), productOfConjugate.getY(), EPS); -Assert.assertEquals(conjugateOfProduct.getZ(), productOfConjugate.getZ(), EPS); +Assertions.assertEquals(productOfConjugate.getW(), conjugateOfProduct.getW(), EPS); +Assertions.assertEquals(productOfConjugate.getX(), conjugateOfProduct.getX(), EPS); +Assertions.assertEquals(productOfConjugate.getY(), conjugateOfProduct.getY(), EPS); +Assertions.assertEquals(productOfConjugate.getZ(), conjugateOfProduct.getZ(), EPS); } -*/ -/* TODO remove dependency on Vector3D + @Test -final void testProductQuaternionVector() { +final void testMultiplyQuaternionVector() { // Case : Product between a vector and a quaternion : QxV @@ -173,48 +153,21 @@ class QuaternionTest { final double[] vector = {2.0, 1.0, 3.0}; final Quaternion qResultQxV = Quaternion.multiply(quaternion, Quaternion.of(vector)); -Assert.assertEquals(-19, qResultQxV.getW(), EPS); -Assert.assertEquals(3, qResultQxV.getX(), EPS); -Assert.assertEquals(-13, qResultQxV.getY(), EPS); -Assert.assertEquals(21, qResultQxV.getZ(), EPS); - -// comparison with the result given by the formula : -// qResult = (- vectorQ . vector) + (scalarQ * vector + vectorQ ^ vector
(commons-numbers) 05/07: Remove TODO about testing the key analysis method
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-numbers.git commit a005a24fd75f13ce12304d192d41d586ca7fa3fd Author: Alex Herbert AuthorDate: Mon Jul 8 11:46:46 2024 +0100 Remove TODO about testing the key analysis method This is benchmarking code and the method is not used in the main release. --- .../org/apache/commons/numbers/examples/jmh/arrays/PartitionTest.java | 1 - .../org/apache/commons/numbers/examples/jmh/arrays/PivotCacheTest.java | 3 --- 2 files changed, 4 deletions(-) diff --git a/commons-numbers-examples/examples-jmh/src/test/java/org/apache/commons/numbers/examples/jmh/arrays/PartitionTest.java b/commons-numbers-examples/examples-jmh/src/test/java/org/apache/commons/numbers/examples/jmh/arrays/PartitionTest.java index 2a7a7d4e..23d94ede 100644 --- a/commons-numbers-examples/examples-jmh/src/test/java/org/apache/commons/numbers/examples/jmh/arrays/PartitionTest.java +++ b/commons-numbers-examples/examples-jmh/src/test/java/org/apache/commons/numbers/examples/jmh/arrays/PartitionTest.java @@ -1740,7 +1740,6 @@ class PartitionTest { new int[] {0, 3, ~8}, new int[] {8, 8})); builder.add(Arguments.of(100, new int[] {9, 6, 7, 8, 2, 1, 1, 3}, allK, 2, 0, new int[] {1, 3, 6, 9}, new int[] {6, 9})); -// TODO: more cases // Repeat the contents of the stream with any case not using the full length of the data. // by padding with random indices (these should be ignored) diff --git a/commons-numbers-examples/examples-jmh/src/test/java/org/apache/commons/numbers/examples/jmh/arrays/PivotCacheTest.java b/commons-numbers-examples/examples-jmh/src/test/java/org/apache/commons/numbers/examples/jmh/arrays/PivotCacheTest.java index 22034454..d815cf27 100644 --- a/commons-numbers-examples/examples-jmh/src/test/java/org/apache/commons/numbers/examples/jmh/arrays/PivotCacheTest.java +++ b/commons-numbers-examples/examples-jmh/src/test/java/org/apache/commons/numbers/examples/jmh/arrays/PivotCacheTest.java @@ -382,7 +382,4 @@ class PivotCacheTest { return builder.build(); } - -// TODO: -// Test moveLeft() }
(commons-numbers) 01/07: Fix PMD ShortMethodName exclusions
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-numbers.git commit 5e81b1edf2a19187b4bbd18529c0f128236b8aa9 Author: Alex Herbert AuthorDate: Mon Jul 8 11:35:40 2024 +0100 Fix PMD ShortMethodName exclusions --- src/conf/pmd/pmd-ruleset.xml | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/pmd/pmd-ruleset.xml b/src/conf/pmd/pmd-ruleset.xml index 3e829c70..a72b73d2 100644 --- a/src/conf/pmd/pmd-ruleset.xml +++ b/src/conf/pmd/pmd-ruleset.xml @@ -74,8 +74,10 @@ - - +
(commons-statistics) 03/03: Update picocli 4.6.1 -> 4.7.6
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-statistics.git commit 31695abfcb1cb51b0c5d96b480db4f588a1e74b7 Author: Alex Herbert AuthorDate: Mon Jul 8 11:24:55 2024 +0100 Update picocli 4.6.1 -> 4.7.6 --- commons-statistics-examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons-statistics-examples/pom.xml b/commons-statistics-examples/pom.xml index 3c521b1..16603c6 100644 --- a/commons-statistics-examples/pom.xml +++ b/commons-statistics-examples/pom.xml @@ -42,7 +42,7 @@ ${basedir}/.. -4.6.1 +4.7.6 3.3.0 3.6.0
(commons-statistics) 02/03: Update maven-shade-plugin 3.2.4 -> 3.6.0
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-statistics.git commit fa0152eba6d95901d1b23f802b0233f933725040 Author: Alex Herbert AuthorDate: Mon Jul 8 11:24:01 2024 +0100 Update maven-shade-plugin 3.2.4 -> 3.6.0 --- commons-statistics-examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons-statistics-examples/pom.xml b/commons-statistics-examples/pom.xml index 717c44a..3c521b1 100644 --- a/commons-statistics-examples/pom.xml +++ b/commons-statistics-examples/pom.xml @@ -44,7 +44,7 @@ 4.6.1 3.3.0 -3.2.4 +3.6.0 false
(commons-statistics) branch master updated (7d88f98 -> 31695ab)
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-statistics.git from 7d88f98 Update jacoco limits for inference module new f567a13 Update exec-maven-plugin 3.0.0 -> 3.3.0 new fa0152e Update maven-shade-plugin 3.2.4 -> 3.6.0 new 31695ab Update picocli 4.6.1 -> 4.7.6 The 3 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: commons-statistics-examples/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
(commons-statistics) 01/03: Update exec-maven-plugin 3.0.0 -> 3.3.0
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-statistics.git commit f567a13597fa1199027f4efe870e72f1f16b30db Author: Alex Herbert AuthorDate: Mon Jul 8 11:22:12 2024 +0100 Update exec-maven-plugin 3.0.0 -> 3.3.0 --- commons-statistics-examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons-statistics-examples/pom.xml b/commons-statistics-examples/pom.xml index fecd678..717c44a 100644 --- a/commons-statistics-examples/pom.xml +++ b/commons-statistics-examples/pom.xml @@ -43,7 +43,7 @@ ${basedir}/.. 4.6.1 -3.0.0 +3.3.0 3.2.4
(commons-numbers) branch master updated (ad7f0a58 -> 1c1b8069)
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-numbers.git from ad7f0a58 Use Commons RNG ArraySampler for shuffle new c86804a3 Update JMH 1.35 -> 1.37 new 1c1b8069 Update exec-maven-plugin 3.0.0 -> 3.3.0 The 2 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: commons-numbers-examples/examples-jmh/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
(commons-numbers) 02/02: Update exec-maven-plugin 3.0.0 -> 3.3.0
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-numbers.git commit 1c1b8069dc9b9702d897c618e65e8416d512f2a6 Author: Alex Herbert AuthorDate: Mon Jul 8 11:11:34 2024 +0100 Update exec-maven-plugin 3.0.0 -> 3.3.0 --- commons-numbers-examples/examples-jmh/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons-numbers-examples/examples-jmh/pom.xml b/commons-numbers-examples/examples-jmh/pom.xml index 0d8ce049..1df0a51a 100644 --- a/commons-numbers-examples/examples-jmh/pom.xml +++ b/commons-numbers-examples/examples-jmh/pom.xml @@ -105,7 +105,7 @@ ${basedir}/../.. -3.0.0 +3.3.0 1.37
(commons-numbers) 01/02: Update JMH 1.35 -> 1.37
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-numbers.git commit c86804a3e7ccc940f6ca5c53ea6e8a7e0689001e Author: Alex Herbert AuthorDate: Mon Jul 8 11:09:55 2024 +0100 Update JMH 1.35 -> 1.37 --- commons-numbers-examples/examples-jmh/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons-numbers-examples/examples-jmh/pom.xml b/commons-numbers-examples/examples-jmh/pom.xml index 949af49a..0d8ce049 100644 --- a/commons-numbers-examples/examples-jmh/pom.xml +++ b/commons-numbers-examples/examples-jmh/pom.xml @@ -108,7 +108,7 @@ 3.0.0 -1.36 +1.37 examples-jmh org.openjdk.jmh.Main
(commons-statistics) 13/18: PMD fix: remove unnecessary cast
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-statistics.git commit 6469b303351dccd8e0086e63f3028e05ca79f87f Author: Alex Herbert AuthorDate: Fri Jul 5 17:48:00 2024 +0100 PMD fix: remove unnecessary cast --- .../java/org/apache/commons/statistics/inference/ChiSquareTest.java | 2 +- .../commons/statistics/inference/KolmogorovSmirnovDistribution.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/ChiSquareTest.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/ChiSquareTest.java index eb70b06..f2d1cb6 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/ChiSquareTest.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/ChiSquareTest.java @@ -240,7 +240,7 @@ public final class ChiSquareTest { // Compare and compute weight only if different final boolean unequalCounts = colSum1 != colSum2; final double weight = unequalCounts ? -Math.sqrt((double) colSum1 / (double) colSum2) : 1; +Math.sqrt((double) colSum1 / colSum2) : 1; // Compute chi-square // This exploits an algebraic rearrangement of the generic n*m contingency table case // for a single sum squared addition per row. diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java index 77e77b9..cb75e3c 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java @@ -240,7 +240,7 @@ final class KolmogorovSmirnovDistribution { int scale = h.scale(); // Omit i == n as this is a no-op for (int i = 1; i < n; ++i) { -pFrac *= (double) i / (double) n; +pFrac *= (double) i / n; if (pFrac < MTW_SCALE_THRESHOLD) { pFrac *= MTW_UP_SCALE; scale -= MTW_UP_SCALE_POWER;
(commons-statistics) 10/18: Update jacoco limits for descriptive module
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-statistics.git commit a56bb402f309aab16313b3f38330c4de94d2828a Author: Alex Herbert AuthorDate: Fri Jul 5 17:38:16 2024 +0100 Update jacoco limits for descriptive module --- commons-statistics-descriptive/pom.xml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/commons-statistics-descriptive/pom.xml b/commons-statistics-descriptive/pom.xml index e53e4ca..06dd6cc 100644 --- a/commons-statistics-descriptive/pom.xml +++ b/commons-statistics-descriptive/pom.xml @@ -40,6 +40,12 @@ ${basedir}/.. descriptive + + +0.99 +0.98 +0.99 +0.99
(commons-statistics) 17/18: Update PMD exclusions for inference module
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-statistics.git commit 040c2dab8df6371f402fd7d41d39f66562556e34 Author: Alex Herbert AuthorDate: Fri Jul 5 17:57:31 2024 +0100 Update PMD exclusions for inference module --- src/conf/pmd/pmd-ruleset.xml | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/conf/pmd/pmd-ruleset.xml b/src/conf/pmd/pmd-ruleset.xml index fe5610f..1233bd7 100644 --- a/src/conf/pmd/pmd-ruleset.xml +++ b/src/conf/pmd/pmd-ruleset.xml @@ -124,7 +124,8 @@ + or @SimpleName='MannWhitneyUTest' or @SimpleName='BrentOptimizer' + or @SimpleName='BracketFinder']"/> @@ -189,6 +190,12 @@ value="./ancestor-or-self::ClassDeclaration[matches(@SimpleName, '^.*Result$')]"/> + + + + +
(commons-statistics) 14/18: PMD fix: Use final
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-statistics.git commit 49d47c3ca6a3ccd96bdff9e24646a7237690028f Author: Alex Herbert AuthorDate: Fri Jul 5 17:51:58 2024 +0100 PMD fix: Use final --- .../apache/commons/statistics/inference/BinomialTest.java | 2 +- .../apache/commons/statistics/inference/BracketFinder.java | 2 +- .../commons/statistics/inference/BrentOptimizer.java | 2 +- .../commons/statistics/inference/FisherExactTest.java | 2 +- .../inference/KolmogorovSmirnovDistribution.java | 4 ++-- .../statistics/inference/KolmogorovSmirnovTest.java| 8 .../org/apache/commons/statistics/inference/TTest.java | 4 ++-- .../statistics/inference/UnconditionedExactTest.java | 14 +++--- .../statistics/inference/WilcoxonSignedRankTest.java | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BinomialTest.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BinomialTest.java index ecad162..e1e9ca3 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BinomialTest.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BinomialTest.java @@ -117,7 +117,7 @@ public final class BinomialTest { } final BinomialDistribution distribution = BinomialDistribution.of(numberOfTrials, probability); -double p; +final double p; if (alternative == AlternativeHypothesis.GREATER_THAN) { p = distribution.survivalProbability(numberOfSuccesses - 1); } else if (alternative == AlternativeHypothesis.LESS_THAN) { diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BracketFinder.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BracketFinder.java index b55042f..ff97829 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BracketFinder.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BracketFinder.java @@ -109,7 +109,7 @@ class BracketFinder { evaluations = 0; // Limit the range of x -DoubleUnaryOperator range; +final DoubleUnaryOperator range; if (min < max) { // Limit: min <= x <= max range = x -> { diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BrentOptimizer.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BrentOptimizer.java index 27bc7c5..0b04598 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BrentOptimizer.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/BrentOptimizer.java @@ -252,7 +252,7 @@ final class BrentOptimizer { // Update by at least "tol1". // Here d is never NaN so the evaluation point u is always finite. -double u; +final double u; if (Math.abs(d) < tol1) { if (d >= 0) { u = x + tol1; diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/FisherExactTest.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/FisherExactTest.java index 85ce3e9..de4bce0 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/FisherExactTest.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/FisherExactTest.java @@ -149,7 +149,7 @@ public final class FisherExactTest { // Note: The distribution validates the population size is > 0 final HypergeometricDistribution distribution = HypergeometricDistribution.of(nn, k, n); -double p; +final double p; if (alternative == AlternativeHypothesis.GREATER_THAN) { p = distribution.survivalProbability(a - 1); } else if (alternative == AlternativeHypothesis.LESS_THAN) { diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java index cb75e3c..9de9b7a 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/KolmogorovSmirnovDistribution.java @@ -380,7 +380,7 @@ final clas
(commons-statistics) 08/18: Update PMD exclusions for descriptive module
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-statistics.git commit 7eba9a47d1b66f27fa81b1be3a29020b6484a89d Author: Alex Herbert AuthorDate: Fri Jul 5 17:28:42 2024 +0100 Update PMD exclusions for descriptive module --- src/conf/pmd/pmd-ruleset.xml | 8 1 file changed, 8 insertions(+) diff --git a/src/conf/pmd/pmd-ruleset.xml b/src/conf/pmd/pmd-ruleset.xml index 0bb9774..fe5610f 100644 --- a/src/conf/pmd/pmd-ruleset.xml +++ b/src/conf/pmd/pmd-ruleset.xml @@ -50,6 +50,9 @@ + + @@ -73,6 +76,11 @@ or @SimpleName='ArrayRealSquareMatrix']"/> + + + + +
(commons-statistics) 15/18: PMD fix: Remove unnecessary qualifier
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-statistics.git commit dd59d10d60f72fcb6ffdb0d8a758adeb97e52998 Author: Alex Herbert AuthorDate: Fri Jul 5 17:52:48 2024 +0100 PMD fix: Remove unnecessary qualifier --- .../main/java/org/apache/commons/statistics/inference/Arguments.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/Arguments.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/Arguments.java index a477693..37dc502 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/Arguments.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/Arguments.java @@ -261,12 +261,12 @@ final class Arguments { final int c = table[1][0]; final int d = table[1][1]; // Bitwise OR combines the sign bit from all values -Arguments.checkNonNegative(a | b | c | d); +checkNonNegative(a | b | c | d); // Sum must be an integer final long sum = (long) a + b + c + d; if (sum > Integer.MAX_VALUE) { throw new InferenceException(InferenceException.X_GT_Y, sum, Integer.MAX_VALUE); } -Arguments.checkStrictlyPositive((int) sum); +checkStrictlyPositive((int) sum); } }
(commons-statistics) branch master updated (85f696b -> 7d88f98)
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-statistics.git from 85f696b Drop javadoc API link new 626abd4 Update commons parent 65 to 71 new c8cf897 Update for PMD 7 new 0b9c065 PMD fix: remove unnecessary cast new 9c5c4f4 PMD fix: Use final new 3bfd1f2 PMD fix: Use package-private constructor new 1556142 Update spotbugs for distribution module new c4fd9ea PMD fix: Remove unnecessary qualifier new 7eba9a4 Update PMD exclusions for descriptive module new ef6f627 Increase edge case test coverage new a56bb40 Update jacoco limits for descriptive module new 1e37d40 Update jacoco limits for ranking module new 7ed5491 Update spotbugs excludes for inference module new 6469b30 PMD fix: remove unnecessary cast new 49d47c3 PMD fix: Use final new dd59d10 PMD fix: Remove unnecessary qualifier new f97691e PMD fix: Use Set interface new 040c2da Update PMD exclusions for inference module new 7d88f98 Update jacoco limits for inference module The 18 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: commons-statistics-descriptive/pom.xml | 6 +++ .../descriptive/SumOfFourthDeviations.java | 4 +- .../commons/statistics/descriptive/Int128Test.java | 5 ++ .../distribution/HypergeometricDistribution.java | 4 +- .../statistics/distribution/TDistribution.java | 4 +- .../distribution/TrapezoidalDistribution.java | 2 +- .../distribution/TruncatedNormalDistribution.java | 4 +- .../distribution/UniformDiscreteDistribution.java | 4 +- commons-statistics-inference/pom.xml | 6 +++ .../commons/statistics/inference/Arguments.java| 8 ++-- .../commons/statistics/inference/BinomialTest.java | 2 +- .../statistics/inference/BracketFinder.java| 2 +- .../statistics/inference/BrentOptimizer.java | 2 +- .../statistics/inference/ChiSquareTest.java| 2 +- .../statistics/inference/FisherExactTest.java | 2 +- .../inference/KolmogorovSmirnovDistribution.java | 6 +-- .../inference/KolmogorovSmirnovTest.java | 8 ++-- .../apache/commons/statistics/inference/TTest.java | 4 +- .../inference/UnconditionedExactTest.java | 14 +++--- .../inference/WilcoxonSignedRankTest.java | 2 +- commons-statistics-ranking/pom.xml | 6 +++ pom.xml| 2 +- src/conf/pmd/pmd-ruleset.xml | 56 +- src/conf/spotbugs/spotbugs-exclude-filter.xml | 14 ++ 24 files changed, 108 insertions(+), 61 deletions(-)
(commons-statistics) 09/18: Increase edge case test coverage
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-statistics.git commit ef6f62774df1e49cb130d475f45b742d517137b0 Author: Alex Herbert AuthorDate: Fri Jul 5 17:37:39 2024 +0100 Increase edge case test coverage --- .../java/org/apache/commons/statistics/descriptive/Int128Test.java | 5 + 1 file changed, 5 insertions(+) diff --git a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/Int128Test.java b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/Int128Test.java index e61ed15..a6aab0a 100644 --- a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/Int128Test.java +++ b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/Int128Test.java @@ -152,6 +152,11 @@ class Int128Test { builder.accept(Arguments.of(rng.nextLong() >>> 1, rng.nextLong(), rng.nextLong() >>> 2, rng.nextLong())); builder.accept(Arguments.of(rng.nextLong(), rng.nextLong(), rng.nextLong(), rng.nextLong())); } +// Special case where hi is non-zero and lo is zero. +// Hit edge case in toDouble() +for (int i = 0; i < 5; i++) { +builder.accept(Arguments.of(rng.nextLong() >>> 3, 0, rng.nextLong() >>> 3, 0)); +} return builder.build(); }
(commons-statistics) 18/18: Update jacoco limits for inference module
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-statistics.git commit 7d88f98eec17e01da60920b0c7871952f961b73e Author: Alex Herbert AuthorDate: Fri Jul 5 18:00:01 2024 +0100 Update jacoco limits for inference module --- commons-statistics-inference/pom.xml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/commons-statistics-inference/pom.xml b/commons-statistics-inference/pom.xml index aec3258..f9bf483 100644 --- a/commons-statistics-inference/pom.xml +++ b/commons-statistics-inference/pom.xml @@ -40,6 +40,12 @@ ${basedir}/.. inference + + +0.99 +0.99 +0.99 +0.99
(commons-statistics) 16/18: PMD fix: Use Set interface
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-statistics.git commit f97691e34b8c00c120449881df325ab7f5a27247 Author: Alex Herbert AuthorDate: Fri Jul 5 17:53:46 2024 +0100 PMD fix: Use Set interface --- .../main/java/org/apache/commons/statistics/inference/Arguments.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/Arguments.java b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/Arguments.java index 37dc502..766ec45 100644 --- a/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/Arguments.java +++ b/commons-statistics-inference/src/main/java/org/apache/commons/statistics/inference/Arguments.java @@ -16,7 +16,7 @@ */ package org.apache.commons.statistics.inference; -import java.util.EnumSet; +import java.util.Set; /** * Argument validation methods. @@ -237,7 +237,7 @@ final class Arguments { * @return the value * @throws IllegalArgumentException if the value is not in the allowed options or is null */ -static > E checkOption(E v, EnumSet allowed) { +static > E checkOption(E v, Set allowed) { if (!allowed.contains(v)) { throw new InferenceException("Invalid option: " + v); }
(commons-statistics) 07/18: PMD fix: Remove unnecessary qualifier
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-statistics.git commit c4fd9ea77c98b5319ff266aa415b66e408325f12 Author: Alex Herbert AuthorDate: Fri Jul 5 17:13:28 2024 +0100 PMD fix: Remove unnecessary qualifier --- .../apache/commons/statistics/descriptive/SumOfFourthDeviations.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/SumOfFourthDeviations.java b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/SumOfFourthDeviations.java index e3e97ba..918a843 100644 --- a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/SumOfFourthDeviations.java +++ b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/SumOfFourthDeviations.java @@ -209,7 +209,7 @@ class SumOfFourthDeviations extends SumOfCubedDeviations { sq += x2 * x2; } // Edge case to avoid floating-point error for zero -if (values.length <= SumOfCubedDeviations.LENGTH_TWO) { +if (values.length <= LENGTH_TWO) { sc = 0; } return new SumOfFourthDeviations(sq, sc, ss, xbar, values.length); @@ -244,7 +244,7 @@ class SumOfFourthDeviations extends SumOfCubedDeviations { sq += x2 * x2; } // Edge case to avoid floating-point error for zero -if (values.length <= SumOfCubedDeviations.LENGTH_TWO) { +if (values.length <= LENGTH_TWO) { sc = 0; } return new SumOfFourthDeviations(sq, sc, ss, xbar, values.length);
(commons-statistics) 12/18: Update spotbugs excludes for inference module
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-statistics.git commit 7ed54915dd399954a30f242b3e97540402e9915a Author: Alex Herbert AuthorDate: Fri Jul 5 17:46:11 2024 +0100 Update spotbugs excludes for inference module --- src/conf/spotbugs/spotbugs-exclude-filter.xml | 9 + 1 file changed, 9 insertions(+) diff --git a/src/conf/spotbugs/spotbugs-exclude-filter.xml b/src/conf/spotbugs/spotbugs-exclude-filter.xml index 112b9a7..b08d2d5 100644 --- a/src/conf/spotbugs/spotbugs-exclude-filter.xml +++ b/src/conf/spotbugs/spotbugs-exclude-filter.xml @@ -50,6 +50,15 @@ + + + + + + + + +
(commons-statistics) 05/18: PMD fix: Use package-private constructor
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-statistics.git commit 3bfd1f21431691869e20cf73d5ef3e299afe4f75 Author: Alex Herbert AuthorDate: Fri Jul 5 16:25:17 2024 +0100 PMD fix: Use package-private constructor --- .../java/org/apache/commons/statistics/distribution/TDistribution.java | 2 +- .../apache/commons/statistics/distribution/TrapezoidalDistribution.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java index 4d277db..93255e6 100644 --- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java +++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java @@ -229,7 +229,7 @@ public abstract class TDistribution extends AbstractContinuousDistribution { /** * @param degreesOfFreedom Degrees of freedom. */ -private TDistribution(double degreesOfFreedom) { +TDistribution(double degreesOfFreedom) { this.degreesOfFreedom = degreesOfFreedom; } diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TrapezoidalDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TrapezoidalDistribution.java index da11161..be4d569 100644 --- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TrapezoidalDistribution.java +++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TrapezoidalDistribution.java @@ -353,7 +353,7 @@ public abstract class TrapezoidalDistribution extends AbstractContinuousDistribu * @param c End of the trapezoid constant density. * @param d Upper limit of this distribution (inclusive). */ -private TrapezoidalDistribution(double a, double b, double c, double d) { +TrapezoidalDistribution(double a, double b, double c, double d) { this.a = a; this.b = b; this.c = c;
(commons-statistics) 02/18: Update for PMD 7
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-statistics.git commit c8cf8970f24e9e5faa752712d7a30d349ea4864e Author: Alex Herbert AuthorDate: Fri Jul 5 16:18:41 2024 +0100 Update for PMD 7 Remove obsolete exclusions Migrate renamed classes (see https://github.com/pmd/pmd/blob/master/docs/pages/pmd/userdocs/migrating_to_pmd7.md#java-ast) --- src/conf/pmd/pmd-ruleset.xml | 39 +-- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/conf/pmd/pmd-ruleset.xml b/src/conf/pmd/pmd-ruleset.xml index 6b83779..0bb9774 100644 --- a/src/conf/pmd/pmd-ruleset.xml +++ b/src/conf/pmd/pmd-ruleset.xml @@ -33,9 +33,7 @@ - - @@ -57,9 +55,7 @@ - - + @@ -73,7 +69,7 @@ - @@ -82,14 +78,13 @@ +value="./ancestor-or-self::MethodDeclaration[@Name='sf' or @Name='of']"/> @@ -119,7 +114,7 @@ @@ -129,21 +124,21 @@ + value="./ancestor-or-self::ClassDeclaration[@SimpleName='AbstractContinuousDistribution']"/> @@ -153,7 +148,7 @@ @@ -163,7 +158,7 @@ @@ -183,7 +178,7 @@ +value="./ancestor-or-self::ClassDeclaration[matches(@SimpleName, '^.*Result$')]"/> @@ -193,7 +188,7 @@ + | ./ancestor-or-self::ClassDeclaration[@SimpleName='Median']"/> @@ -201,7 +196,7 @@ @@ -221,7 +216,7 @@ + value="./ancestor-or-self::ClassDeclaration[@SimpleName='NaNTransformers']"/> @@ -229,7 +224,7 @@ + value="./ancestor-or-self::ClassDeclaration[@SimpleName='ArrayRealSquareMatrix']"/> @@ -237,7 +232,7 @@
(commons-statistics) 03/18: PMD fix: remove unnecessary cast
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-statistics.git commit 0b9c0655bed3d3ca88e51bfceac39db02db67d04 Author: Alex Herbert AuthorDate: Fri Jul 5 16:22:58 2024 +0100 PMD fix: remove unnecessary cast --- .../commons/statistics/distribution/HypergeometricDistribution.java | 4 ++-- .../commons/statistics/distribution/UniformDiscreteDistribution.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/HypergeometricDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/HypergeometricDistribution.java index e8ed472..6d2a4b9 100644 --- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/HypergeometricDistribution.java +++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/HypergeometricDistribution.java @@ -72,8 +72,8 @@ public final class HypergeometricDistribution extends AbstractDiscreteDistributi this.sampleSize = sampleSize; lowerBound = getLowerDomain(populationSize, numberOfSuccesses, sampleSize); upperBound = getUpperDomain(numberOfSuccesses, sampleSize); -bp = (double) sampleSize / (double) populationSize; -bq = (double) (populationSize - sampleSize) / (double) populationSize; +bp = (double) sampleSize / populationSize; +bq = (double) (populationSize - sampleSize) / populationSize; } /** diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/UniformDiscreteDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/UniformDiscreteDistribution.java index d95dc99..19807a8 100644 --- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/UniformDiscreteDistribution.java +++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/UniformDiscreteDistribution.java @@ -57,7 +57,7 @@ public final class UniformDiscreteDistribution extends AbstractDiscreteDistribut int upper) { this.lower = lower; this.upper = upper; -upperMinusLowerPlus1 = (double) upper - (double) lower + 1; +upperMinusLowerPlus1 = (double) upper - lower + 1; pmf = 1.0 / upperMinusLowerPlus1; logPmf = -Math.log(upperMinusLowerPlus1); sf0 = (upperMinusLowerPlus1 - 1) / upperMinusLowerPlus1; @@ -221,7 +221,7 @@ public final class UniformDiscreteDistribution extends AbstractDiscreteDistribut @Override public double getMean() { // Avoid overflow -return 0.5 * ((double) upper + (double) lower); +return 0.5 * ((double) upper + lower); } /**
(commons-statistics) 01/18: Update commons parent 65 to 71
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-statistics.git commit 626abd4180a75a560416dc9c8c718e8bae8507c6 Author: Alex Herbert AuthorDate: Fri Jul 5 16:14:41 2024 +0100 Update commons parent 65 to 71 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0da68cb..3232dae 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ org.apache.commons commons-parent -65 +71 4.0.0
(commons-statistics) 11/18: Update jacoco limits for ranking module
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-statistics.git commit 1e37d40188b5305901c92f67f0cae80d4f8da88e Author: Alex Herbert AuthorDate: Fri Jul 5 17:41:07 2024 +0100 Update jacoco limits for ranking module --- commons-statistics-ranking/pom.xml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/commons-statistics-ranking/pom.xml b/commons-statistics-ranking/pom.xml index ed81f6a..e1b3168 100644 --- a/commons-statistics-ranking/pom.xml +++ b/commons-statistics-ranking/pom.xml @@ -40,6 +40,12 @@ ${basedir}/.. ranking + + +0.98 +0.96 +0.98 +0.96
(commons-statistics) 06/18: Update spotbugs for distribution module
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-statistics.git commit 15561422b01ec60adeb750e056e5d4f28f9c00aa Author: Alex Herbert AuthorDate: Fri Jul 5 16:37:52 2024 +0100 Update spotbugs for distribution module --- src/conf/spotbugs/spotbugs-exclude-filter.xml | 5 + 1 file changed, 5 insertions(+) diff --git a/src/conf/spotbugs/spotbugs-exclude-filter.xml b/src/conf/spotbugs/spotbugs-exclude-filter.xml index f7080ec..112b9a7 100644 --- a/src/conf/spotbugs/spotbugs-exclude-filter.xml +++ b/src/conf/spotbugs/spotbugs-exclude-filter.xml @@ -38,6 +38,11 @@ + + + + +
(commons-statistics) 04/18: PMD fix: Use final
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-statistics.git commit 9c5c4f47ec59a36d256320e964d8179697b7cfc2 Author: Alex Herbert AuthorDate: Fri Jul 5 16:24:01 2024 +0100 PMD fix: Use final --- .../org/apache/commons/statistics/distribution/TDistribution.java | 2 +- .../commons/statistics/distribution/TruncatedNormalDistribution.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java index 54c6b2c..4d277db 100644 --- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java +++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java @@ -193,7 +193,7 @@ public abstract class TDistribution extends AbstractContinuousDistribution { // https://www.boost.org/doc/libs/1_78_0/libs/math/doc/html/math_toolkit/dist_ref/dists/students_t_dist.html final double t2 = x * x; -double z; +final double z; if (v < 2 * t2) { z = RegularizedBeta.value(v / (v + t2), v / 2, 0.5) / 2; } else { diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TruncatedNormalDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TruncatedNormalDistribution.java index 5a99ee7..e6eb2a4 100644 --- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TruncatedNormalDistribution.java +++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TruncatedNormalDistribution.java @@ -247,7 +247,7 @@ public final class TruncatedNormalDistribution extends AbstractContinuousDistrib if (cdfDelta > threshold) { // Create the rejection sampler final ZigguratSampler.NormalizedGaussian sampler = ZigguratSampler.NormalizedGaussian.of(rng); -DoubleSupplier gen; +final DoubleSupplier gen; // Use mirroring if possible if (lower >= 0) { // Return the upper-half of the Gaussian @@ -440,7 +440,7 @@ public final class TruncatedNormalDistribution extends AbstractContinuousDistrib // dx = -0.5*(b*b-a*a) final double dx = 0.5 * (b + a) * (b - a); -double m; +final double m; if (a <= 0) { // Opposite signs m = ROOT_2_PI * -Math.expm1(-dx) * Math.exp(-0.5 * a * a) / ErfDifference.value(a / ROOT2, b / ROOT2);
(commons-statistics) branch master updated: Drop javadoc API link
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-statistics.git The following commit(s) were added to refs/heads/master by this push: new 85f696b Drop javadoc API link 85f696b is described below commit 85f696b20d93e52e362488d9df238796bb3d3f8b Author: Alex Herbert AuthorDate: Fri Jul 5 16:06:09 2024 +0100 Drop javadoc API link --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index f486e77..0da68cb 100644 --- a/pom.xml +++ b/pom.xml @@ -332,7 +332,6 @@ - https://commons.apache.org/proper/commons-rng/commons-rng-client-api/javadocs/api-${statistics.commons.rng.version}/ true @@ -448,7 +447,6 @@ - https://commons.apache.org/proper/commons-rng/commons-rng-client-api/javadocs/api-${statistics.commons.rng.version}/ true
(commons-statistics) branch master updated: Update line numbers for checkstyle exclusions
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-statistics.git The following commit(s) were added to refs/heads/master by this push: new 0ad1801 Update line numbers for checkstyle exclusions 0ad1801 is described below commit 0ad180113158deccafa0c07ef910d20c26b3c3b3 Author: Alex Herbert AuthorDate: Fri Jul 5 15:56:25 2024 +0100 Update line numbers for checkstyle exclusions --- src/conf/checkstyle/checkstyle-suppressions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/checkstyle/checkstyle-suppressions.xml b/src/conf/checkstyle/checkstyle-suppressions.xml index e5d1b95..4f96cb1 100644 --- a/src/conf/checkstyle/checkstyle-suppressions.xml +++ b/src/conf/checkstyle/checkstyle-suppressions.xml @@ -39,7 +39,7 @@ - +
(commons-statistics) 02/03: Use Commons RNG ArraySampler for shuffle
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-statistics.git commit 0d4e38106904d6b20725707fceea898508062224 Author: Alex Herbert AuthorDate: Fri Jul 5 15:42:02 2024 +0100 Use Commons RNG ArraySampler for shuffle --- .../descriptive/BaseDoubleStatisticTest.java | 13 +- .../descriptive/BaseIntStatisticTest.java | 13 +- .../descriptive/BaseLongStatisticTest.java | 13 +- .../commons/statistics/descriptive/MedianTest.java | 7 +- .../commons/statistics/descriptive/TestHelper.java | 131 - .../jmh/descriptive/QuantilePerformance.java | 35 +- .../statistics/ranking/NaturalRankingTest.java | 3 +- 7 files changed, 31 insertions(+), 184 deletions(-) diff --git a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseDoubleStatisticTest.java b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseDoubleStatisticTest.java index 94d64ec..34431f5 100644 --- a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseDoubleStatisticTest.java +++ b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/BaseDoubleStatisticTest.java @@ -25,6 +25,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.Stream.Builder; import org.apache.commons.rng.UniformRandomProvider; +import org.apache.commons.rng.sampling.ArraySampler; import org.apache.commons.statistics.distribution.DoubleTolerance; import org.apache.commons.statistics.distribution.DoubleTolerances; import org.apache.commons.statistics.distribution.TestUtils; @@ -1130,7 +1131,7 @@ abstract class BaseDoubleStatisticTestUses Fisher-Yates shuffle copied from - * https://github.com/apache/commons-rng/blob/master/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/ArraySampler.java;> - * RNG ArraySampler. - * - * TODO: This can be removed when {@code commons-rng-sampling 1.6} is released. - * - * @param rng Source of randomness. - * @param array Array whose entries will be shuffled (in-place). - * @return Shuffled input array. - */ -static double[] shuffle(UniformRandomProvider rng, double[] array) { -for (int i = array.length; i > 1; i--) { -swap(array, i - 1, rng.nextInt(i)); -} -return array; -} - -/** - * Shuffles the entries of the given array. - * - * Uses Fisher-Yates shuffle copied from - * https://github.com/apache/commons-rng/blob/master/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/ArraySampler.java;> - * RNG ArraySampler. - * - * TODO: This can be removed when {@code commons-rng-sampling 1.6} is released. - * - * @param rng Source of randomness. - * @param array Array whose entries will be shuffled (in-place). - * @return Shuffled input array. - */ -static int[] shuffle(UniformRandomProvider rng, int[] array) { -for (int i = array.length; i > 1; i--) { -swap(array, i - 1, rng.nextInt(i)); -} -return array; -} - -/** - * Shuffles the entries of the given array. - * - * Uses Fisher-Yates shuffle copied from - * https://github.com/apache/commons-rng/blob/master/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/ArraySampler.java;> - * RNG ArraySampler. - * - * TODO: This can be removed when {@code commons-rng-sampling 1.6} is released. - * - * @param rng Source of randomness. - * @param array Array whose entries will be shuffled (in-place). - * @return Shuffled input array. - */ -static long[] shuffle(UniformRandomProvider rng, long[] array) { -for (int i = array.length; i > 1; i--) { -swap(array, i - 1, rng.nextInt(i)); -} -return array; -} - -/** - * Shuffles the entries of the given array. - * - * Uses Fisher-Yates shuffle copied from - * https://github.com/apache/commons-rng/blob/master/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/ArraySampler.java;> - * RNG ArraySampler. - * - * TODO: This can be removed when {@code commons-rng-sampling 1.6} is released. - * - * @param rng Source of randomness. - * @param array Array whose entries will be shuffled (in-place). - * @return Shuffled input array. - */ -static T[] shuffle(UniformRandomProvider rng, T[] array) { -for (int i = array.length; i > 1; i--) { -swap(array, i - 1, rng.nextInt(i)); -} -return array; -} - -/** - * Swaps the two specified elements in the array. - * - * @param array Array. - * @param i First index. -
(commons-statistics) 03/03: STATISTICS-60: Remove manipulation of p-values from the Pareto sampler
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-statistics.git commit 20f951a91698c84cc7965966d50ac0ebd528a478 Author: Alex Herbert AuthorDate: Fri Jul 5 15:49:25 2024 +0100 STATISTICS-60: Remove manipulation of p-values from the Pareto sampler Commons RNG 1.6 implements this adaption directly. --- .../distribution/ParetoDistribution.java | 40 ++ 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ParetoDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ParetoDistribution.java index 88d292b..c5af239 100644 --- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ParetoDistribution.java +++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ParetoDistribution.java @@ -295,43 +295,7 @@ public final class ParetoDistribution extends AbstractContinuousDistribution { /** {@inheritDoc} */ @Override public ContinuousDistribution.Sampler createSampler(final UniformRandomProvider rng) { -// Pareto distribution sampler. -// Commons RNG v1.5 uses nextDouble for (1 - p) effectively sampling from p in (0, 1]. -// Ensure sampling is concentrated at the lower / upper bound at extreme shapes: -// Large shape should sample using p in [0, 1) (lower bound) -// Small shape should sample using p in (0, 1] (upper bound) -// Note: For small shape the input RNG is also wrapped to use nextLong as the source of -// randomness; this ensures the nextDouble method uses the interface output of [0, 1). -// Commons RNG v1.6 uses nextLong and will not be affected by changes to nextDouble. -final UniformRandomProvider wrappedRng = shape >= 1 ? new InvertedRNG(rng) : rng::nextLong; -return InverseTransformParetoSampler.of(wrappedRng, scale, shape)::sample; -} - -/** - * Create a RNG that inverts the output from nextDouble() as (1 - nextDouble()). - */ -private static class InvertedRNG implements UniformRandomProvider { -/** Source of randomness. */ -private final UniformRandomProvider rng; - -/** - * @param rng Source of randomness - */ -InvertedRNG(UniformRandomProvider rng) { -this.rng = rng; -} - -@Override -public long nextLong() { -// Delegate the source of randomness -return rng.nextLong(); -} - -@Override -public double nextDouble() { -// Return a value in (0, 1]. -// This assumes the interface method outputs in [0, 1). -return 1 - UniformRandomProvider.super.nextDouble(); -} +// Pareto distribution sampler +return InverseTransformParetoSampler.of(rng, scale, shape)::sample; } }
(commons-statistics) 01/03: Update to RNG 1.6-SNAPSHOT
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-statistics.git commit 934d5c95e18e6d8205d757011533ef13cefaf5ef Author: Alex Herbert AuthorDate: Fri Jul 5 15:34:05 2024 +0100 Update to RNG 1.6-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b65405..f486e77 100644 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ -Xdoclint:all -1.5 + 1.6-SNAPSHOT 1.2-SNAPSHOT 3.6.1 4.0-beta1
(commons-statistics) branch master updated (5b50dce -> 20f951a)
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-statistics.git from 5b50dce Remove polyfill script new 934d5c9 Update to RNG 1.6-SNAPSHOT new 0d4e381 Use Commons RNG ArraySampler for shuffle new 20f951a STATISTICS-60: Remove manipulation of p-values from the Pareto sampler The 3 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: .../descriptive/BaseDoubleStatisticTest.java | 13 +- .../descriptive/BaseIntStatisticTest.java | 13 +- .../descriptive/BaseLongStatisticTest.java | 13 +- .../commons/statistics/descriptive/MedianTest.java | 7 +- .../commons/statistics/descriptive/TestHelper.java | 131 - .../distribution/ParetoDistribution.java | 40 +-- .../jmh/descriptive/QuantilePerformance.java | 35 +- .../statistics/ranking/NaturalRankingTest.java | 3 +- pom.xml| 2 +- 9 files changed, 34 insertions(+), 223 deletions(-)
(commons-numbers) branch master updated (c7b38b3f -> ad7f0a58)
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-numbers.git from c7b38b3f Update jacoco limits for root solver module new e6618fae Update to RNG 1.6-SNAPSHOT new ad7f0a58 Use Commons RNG ArraySampler for shuffle The 2 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: .../commons/numbers/arrays/SelectionTest.java | 85 -- .../numbers/arrays/UpdatingIntervalTest.java | 6 +- commons-numbers-core/pom.xml | 5 ++ .../commons/numbers/core/ArithmeticUtilsTest.java | 10 ++- .../examples/jmh/arrays/SelectionPerformance.java | 66 ++--- .../examples/jmh/arrays/KthSelectorTest.java | 13 ++-- .../numbers/examples/jmh/arrays/PartitionTest.java | 15 ++-- .../examples/jmh/arrays/PivotingStrategyTest.java | 3 +- .../numbers/examples/jmh/arrays/TestUtils.java | 58 --- pom.xml| 2 +- 10 files changed, 54 insertions(+), 209 deletions(-)
(commons-numbers) 01/02: Update to RNG 1.6-SNAPSHOT
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-numbers.git commit e6618fae00d6869bf73b13fa60c59d725542d29f Author: Alex Herbert AuthorDate: Fri Jul 5 15:08:05 2024 +0100 Update to RNG 1.6-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3650ffb5..ae284632 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ -Xdoclint:all -1.5 +1.6-SNAPSHOT 3.6.1
(commons-numbers) 02/02: Use Commons RNG ArraySampler for shuffle
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-numbers.git commit ad7f0a582a7a585dd9dab0b196ae8c9cdf3a65e4 Author: Alex Herbert AuthorDate: Fri Jul 5 15:32:18 2024 +0100 Use Commons RNG ArraySampler for shuffle --- .../commons/numbers/arrays/SelectionTest.java | 85 -- .../numbers/arrays/UpdatingIntervalTest.java | 6 +- commons-numbers-core/pom.xml | 5 ++ .../commons/numbers/core/ArithmeticUtilsTest.java | 10 ++- .../examples/jmh/arrays/SelectionPerformance.java | 66 ++--- .../examples/jmh/arrays/KthSelectorTest.java | 13 ++-- .../numbers/examples/jmh/arrays/PartitionTest.java | 15 ++-- .../examples/jmh/arrays/PivotingStrategyTest.java | 3 +- .../numbers/examples/jmh/arrays/TestUtils.java | 58 --- 9 files changed, 53 insertions(+), 208 deletions(-) diff --git a/commons-numbers-arrays/src/test/java/org/apache/commons/numbers/arrays/SelectionTest.java b/commons-numbers-arrays/src/test/java/org/apache/commons/numbers/arrays/SelectionTest.java index efc5d346..e67a8815 100644 --- a/commons-numbers-arrays/src/test/java/org/apache/commons/numbers/arrays/SelectionTest.java +++ b/commons-numbers-arrays/src/test/java/org/apache/commons/numbers/arrays/SelectionTest.java @@ -22,6 +22,7 @@ import java.util.function.Consumer; import java.util.stream.IntStream; import java.util.stream.Stream; import org.apache.commons.rng.UniformRandomProvider; +import org.apache.commons.rng.sampling.ArraySampler; import org.apache.commons.rng.simple.RandomSource; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assumptions; @@ -219,34 +220,6 @@ class SelectionTest { } } -/** - * Shuffles the entries of the given array. - * - * @param rng Source of randomness. - * @param array Array whose entries will be shuffled (in-place). - * @return Shuffled input array. - */ -// TODO - replace with Commons RNG 1.6: o.a.c.rng.sampling.ArraySampler -private static double[] shuffle(UniformRandomProvider rng, double[] array) { -for (int i = array.length; i > 1; i--) { -swap(array, i - 1, rng.nextInt(i)); -} -return array; -} - -/** - * Swaps the two specified elements in the array. - * - * @param array Array. - * @param i First index. - * @param j Second index. - */ -private static void swap(double[] array, int i, int j) { -final double tmp = array[i]; -array[i] = array[j]; -array[j] = tmp; -} - @ParameterizedTest @MethodSource(value = {"testDoubleHeapSelect", "testDoubleSelectMinMax", "testDoubleSelectMinMax2"}) void testDoubleHeapSelectLeft(double[] values, int from, int to) { @@ -648,10 +621,10 @@ class SelectionTest { // Note: Duplicate indices do not matter final int[] indices = rng.ints(k, 0, size).toArray(); builder.add(Arguments.of( -shuffle(rng, values.clone()), +ArraySampler.shuffle(rng, values.clone()), indices.clone())); builder.add(Arguments.of( -shuffle(rng, zeros.clone()), +ArraySampler.shuffle(rng, zeros.clone()), indices.clone())); } } @@ -666,7 +639,7 @@ class SelectionTest { // This sets a low index indices[rng.nextInt(indices.length)] = rng.nextInt(0, limit >>> 1); builder.add(Arguments.of( -shuffle(rng, values.clone()), +ArraySampler.shuffle(rng, values.clone()), indices.clone())); } } @@ -704,14 +677,14 @@ class SelectionTest { Arrays.fill(x, n - i6, n - i2, p2); // Equal value in between the pivots Arrays.fill(x, i6, n - i6, (p1 + p2) / 2); -// Shuffle this and partition in the middle. +// ArraySampler.shuffle this and partition in the middle. // Also partition with the pivots in P1 and P2 using thirds. final int third = (int) (n / 3.0); // Use a fix seed to ensure we hit coverage with only 5 loops. rng = RandomSource.XO_SHI_RO_128_PP.create(-8111061151820577011L); for (int i = 0; i < 5; i++) { -builder.add(Arguments.of(shuffle(rng, x.clone()), new int[] {n >> 1})); -builder.add(Arguments.of(shuffle(rng, x.clone()), +builder.add(Arguments.of(ArraySampler.shuffle(rng, x.clone()), new int[] {n >> 1})); +builder.add(Arguments.of(ArraySampler.shuffle(rng, x.clone()), new int[] {t
(commons-numbers) 16/31: PMD fix: Add package-private constructor
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-numbers.git commit 85ec2ccb73f19f8ba898dd8d2c928f63e5550924 Author: Alex Herbert AuthorDate: Fri Jul 5 10:42:32 2024 +0100 PMD fix: Add package-private constructor --- .../src/main/java/org/apache/commons/numbers/quaternion/Slerp.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commons-numbers-quaternion/src/main/java/org/apache/commons/numbers/quaternion/Slerp.java b/commons-numbers-quaternion/src/main/java/org/apache/commons/numbers/quaternion/Slerp.java index 6de55bd2..c20d5920 100644 --- a/commons-numbers-quaternion/src/main/java/org/apache/commons/numbers/quaternion/Slerp.java +++ b/commons-numbers-quaternion/src/main/java/org/apache/commons/numbers/quaternion/Slerp.java @@ -100,6 +100,9 @@ public class Slerp implements DoubleFunction { * Linear interpolation, used when the quaternions are too closely aligned. */ private final class Linear implements DoubleFunction { +/** Package-private constructor. */ +Linear() {} + /** {@inheritDoc} */ @Override public Quaternion apply(double t) {
(commons-numbers) 29/31: Increase coverage for BrentSolver
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-numbers.git commit d9cbc0c20206eecbbc7fde3b8816ce821a98ba5f Author: Alex Herbert AuthorDate: Fri Jul 5 14:54:30 2024 +0100 Increase coverage for BrentSolver --- .../org/apache/commons/numbers/rootfinder/BrentSolverTest.java| 8 1 file changed, 8 insertions(+) diff --git a/commons-numbers-rootfinder/src/test/java/org/apache/commons/numbers/rootfinder/BrentSolverTest.java b/commons-numbers-rootfinder/src/test/java/org/apache/commons/numbers/rootfinder/BrentSolverTest.java index 07226d36..d29e628c 100644 --- a/commons-numbers-rootfinder/src/test/java/org/apache/commons/numbers/rootfinder/BrentSolverTest.java +++ b/commons-numbers-rootfinder/src/test/java/org/apache/commons/numbers/rootfinder/BrentSolverTest.java @@ -225,6 +225,14 @@ class BrentSolverTest { // Ensure expected error condition. Assertions.assertNotEquals(-1, ex.getMessage().indexOf("out of range")); } + +try { +double result = solver.findRoot(func, 0.0, -7.0, 0.6); +Assertions.fail("an out of range condition was expected"); +} catch (SolverException ex) { +// Ensure expected error condition. +Assertions.assertNotEquals(-1, ex.getMessage().indexOf("out of range")); +} } @Test
(commons-numbers) 24/31: Update jacoco limits for gamma module
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-numbers.git commit 00036b0172954e0ffac9bfbb669f814737aeea7d Author: Alex Herbert AuthorDate: Fri Jul 5 14:38:18 2024 +0100 Update jacoco limits for gamma module --- commons-numbers-gamma/pom.xml | 4 1 file changed, 4 insertions(+) diff --git a/commons-numbers-gamma/pom.xml b/commons-numbers-gamma/pom.xml index 5ce3fb0d..55aaf2c3 100644 --- a/commons-numbers-gamma/pom.xml +++ b/commons-numbers-gamma/pom.xml @@ -39,6 +39,10 @@ ${basedir}/.. gamma + + +0.98 +0.97
(commons-numbers) 08/31: Increase coverage for PrecisionTest
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-numbers.git commit bbd622ff2527818b9e3e010ab41943a645341f14 Author: Alex Herbert AuthorDate: Thu Jul 4 16:31:58 2024 +0100 Increase coverage for PrecisionTest --- .../test/java/org/apache/commons/numbers/core/PrecisionTest.java| 6 ++ 1 file changed, 6 insertions(+) diff --git a/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/PrecisionTest.java b/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/PrecisionTest.java index 8da2abc0..db5619c5 100644 --- a/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/PrecisionTest.java +++ b/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/PrecisionTest.java @@ -261,6 +261,12 @@ class PrecisionTest { Assertions.assertFalse(fun.equals(Double.NaN, Double.POSITIVE_INFINITY, 0)); Assertions.assertFalse(fun.equals(Double.NaN, Double.NEGATIVE_INFINITY, 0)); +// Create a NaN representation 1 ulp above infinity. +// This hits not equal coverage for binary representations within the ulp but using NaN. +final double nan = Double.longBitsToDouble(Double.doubleToRawLongBits(Double.POSITIVE_INFINITY) + 1); +Assertions.assertFalse(fun.equals(nan, Double.POSITIVE_INFINITY, 1)); +Assertions.assertFalse(fun.equals(Double.POSITIVE_INFINITY, nan, 1)); + if (!fixed1Ulp) { Assertions.assertFalse(fun.equals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Integer.MAX_VALUE)); Assertions.assertFalse(fun.equals(0, Double.MAX_VALUE, Integer.MAX_VALUE));
(commons-numbers) 20/31: PMD fix: Remove unnecessary qualifier
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-numbers.git commit 930ce2c68e97934ef57533b7e7698b78124b37bd Author: Alex Herbert AuthorDate: Fri Jul 5 13:39:03 2024 +0100 PMD fix: Remove unnecessary qualifier --- .../src/main/java/org/apache/commons/numbers/angle/Angle.java | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Angle.java b/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Angle.java index 8ed2d924..d38c3c8d 100644 --- a/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Angle.java +++ b/commons-numbers-angle/src/main/java/org/apache/commons/numbers/angle/Angle.java @@ -93,7 +93,7 @@ public abstract class Angle implements DoubleSupplier { */ public static final class Turn extends Angle { /** Zero. */ -public static final Turn ZERO = Turn.of(0d); +public static final Turn ZERO = of(0d); /** Normalizing operator (result will be within the {@code [0, 1[} interval). */ public static final DoubleUnaryOperator WITHIN_0_AND_1 = normalizer(0d); @@ -147,11 +147,11 @@ public abstract class Angle implements DoubleSupplier { */ public static final class Rad extends Angle { /** Zero. */ -public static final Rad ZERO = Rad.of(0d); +public static final Rad ZERO = of(0d); /** . */ -public static final Rad PI = Rad.of(Math.PI); +public static final Rad PI = of(Math.PI); /** 2. */ -public static final Rad TWO_PI = Rad.of(Angle.TWO_PI); +public static final Rad TWO_PI = of(Angle.TWO_PI); /** Normalizing operator (result will be within the [0, 2[ interval). */ public static final DoubleUnaryOperator WITHIN_0_AND_2PI = normalizer(0d); /** Normalizing operator (result will be within the [-, [ interval). */ @@ -207,7 +207,7 @@ public abstract class Angle implements DoubleSupplier { */ public static final class Deg extends Angle { /** Zero. */ -public static final Deg ZERO = Deg.of(0d); +public static final Deg ZERO = of(0d); /** Normalizing operator (result will be within the {@code [0, 360[} interval). */ public static final DoubleUnaryOperator WITHIN_0_AND_360 = normalizer(0d);
(commons-numbers) 23/31: Remove unreachable code
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-numbers.git commit cb4c791b6f5b78bc5fb5e449864f8c251bed8869 Author: Alex Herbert AuthorDate: Fri Jul 5 14:38:01 2024 +0100 Remove unreachable code --- .../org/apache/commons/numbers/gamma/LogBeta.java | 29 -- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogBeta.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogBeta.java index 6f08a9fb..db7cd93c 100644 --- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogBeta.java +++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogBeta.java @@ -83,13 +83,8 @@ public final class LogBeta { */ private static double deltaMinusDeltaSum(final double a, final double b) { -if (a < 0 || -a > b) { -throw new GammaException(GammaException.OUT_OF_RANGE, a, 0, b); -} -if (b < TEN) { -throw new GammaException(GammaException.OUT_OF_RANGE, b, TEN, Double.POSITIVE_INFINITY); -} +// Assumptions: +// Never called with a < 0; a > b; or b < 10 final double h = a / b; final double p = h / (1 + h); @@ -193,7 +188,7 @@ public final class LogBeta { } double prod1 = 1; double ared = a; -while (ared > 2) { +while (ared > TWO) { ared -= 1; final double h = ared / b; prod1 *= h / (1 + h); @@ -201,7 +196,7 @@ public final class LogBeta { if (b < TEN) { double prod2 = 1; double bred = b; -while (bred > 2) { +while (bred > TWO) { bred -= 1; prod2 *= bred / (ared + bred); } @@ -219,7 +214,7 @@ public final class LogBeta { if (b < TEN) { double prod = 1; double bred = b; -while (bred > 2) { +while (bred > TWO) { bred -= 1; prod *= bred / (a + bred); } @@ -257,6 +252,8 @@ public final class LogBeta { * Based on the NSWC Library of Mathematics Subroutines implementation, * {@code DLGDIV}. * + * This method assumes \( a \leq b \). + * * @param a First argument. * @param b Second argument. * @return the value of \( \log(\Gamma(b) / \Gamma(a + b) \). @@ -274,15 +271,9 @@ public final class LogBeta { /* * d = a + b - 0.5 */ -final double d; -final double w; -if (a <= b) { -d = b + (a - 0.5); -w = deltaMinusDeltaSum(a, b); -} else { -d = a + (b - 0.5); -w = deltaMinusDeltaSum(b, a); -} +// Assumption: always called with a <= b. +final double d = b + (a - 0.5); +final double w = deltaMinusDeltaSum(a, b); final double u = d * Math.log1p(a / b); final double v = a * (Math.log(b) - 1);
(commons-numbers) 12/31: Remove unreachable code
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-numbers.git commit e3fe38bdf6961b235de0c4c915ab827744026f65 Author: Alex Herbert AuthorDate: Fri Jul 5 10:24:10 2024 +0100 Remove unreachable code --- .../main/java/org/apache/commons/numbers/primes/SmallPrimes.java| 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commons-numbers-primes/src/main/java/org/apache/commons/numbers/primes/SmallPrimes.java b/commons-numbers-primes/src/main/java/org/apache/commons/numbers/primes/SmallPrimes.java index 8acd0684..2e78d938 100644 --- a/commons-numbers-primes/src/main/java/org/apache/commons/numbers/primes/SmallPrimes.java +++ b/commons-numbers-primes/src/main/java/org/apache/commons/numbers/primes/SmallPrimes.java @@ -212,9 +212,9 @@ final class SmallPrimes { } } } -if (n != 1) { -factors.add(n); -} +// Note: When this method is used after the small trial division n != 1 +// for all n in [2, MAX_VALUE] (tested using an exhaustive enumeration). +factors.add(n); return n; }
(commons-numbers) 15/31: PMD fix: Remove explicit boxing
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-numbers.git commit 3a47692bd3381d93846141bac425e463762ed6fb Author: Alex Herbert AuthorDate: Fri Jul 5 10:32:21 2024 +0100 PMD fix: Remove explicit boxing --- .../java/org/apache/commons/numbers/primes/SmallPrimes.java| 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commons-numbers-primes/src/main/java/org/apache/commons/numbers/primes/SmallPrimes.java b/commons-numbers-primes/src/main/java/org/apache/commons/numbers/primes/SmallPrimes.java index 875d68eb..aed4b8f5 100644 --- a/commons-numbers-primes/src/main/java/org/apache/commons/numbers/primes/SmallPrimes.java +++ b/commons-numbers-primes/src/main/java/org/apache/commons/numbers/primes/SmallPrimes.java @@ -107,11 +107,11 @@ final class SmallPrimes { of all integers. */ final Set primeNumbers = new HashSet<>(); -primeNumbers.add(Integer.valueOf(2)); -primeNumbers.add(Integer.valueOf(3)); -primeNumbers.add(Integer.valueOf(5)); -primeNumbers.add(Integer.valueOf(7)); -primeNumbers.add(Integer.valueOf(11)); +primeNumbers.add(2); +primeNumbers.add(3); +primeNumbers.add(5); +primeNumbers.add(7); +primeNumbers.add(11); final int product = primeNumbers.stream().reduce(1, (a, b) -> a * b); final int[] equivalenceClasses = new int[primeNumbers.stream().mapToInt(a -> a - 1).reduce(1, (a, b) -> a * b)];