You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2022/01/23 23:02:35 UTC

[commons-numbers] branch master updated (c32f544 -> 448c7a3)

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

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


    from c32f544  NUMBERS-181: Track changes
     new 6251464  Upgrade parent POM.
     new 448c7a3  Replace deprecated calls.

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:
 .../org/apache/commons/numbers/complex/CStandardTest.java    |  8 ++++----
 .../java/org/apache/commons/numbers/complex/ComplexTest.java | 12 ++++++------
 .../test/java/org/apache/commons/numbers/core/NormTest.java  |  8 ++++----
 pom.xml                                                      |  2 +-
 4 files changed, 15 insertions(+), 15 deletions(-)

[commons-numbers] 02/02: Replace deprecated calls.

Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 448c7a3ae7bdf10f41c4462398e54cc7177d6c46
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Mon Jan 24 00:02:03 2022 +0100

    Replace deprecated calls.
---
 .../org/apache/commons/numbers/complex/CStandardTest.java    |  8 ++++----
 .../java/org/apache/commons/numbers/complex/ComplexTest.java | 12 ++++++------
 .../test/java/org/apache/commons/numbers/core/NormTest.java  |  8 ++++----
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/CStandardTest.java b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/CStandardTest.java
index c4cf9be..42e6e9d 100644
--- a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/CStandardTest.java
+++ b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/CStandardTest.java
@@ -262,7 +262,7 @@ class CStandardTest {
             }
         }
         // Random numbers
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.SPLIT_MIX_64);
+        final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
         for (int i = 0; i < 100; i++) {
             final double x = next(rng);
             final double y = next(rng);
@@ -331,7 +331,7 @@ class CStandardTest {
             }
         }
         // Random numbers
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.SPLIT_MIX_64);
+        final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
         for (int i = 0; i < 100; i++) {
             final double x = next(rng);
             final double y = next(rng);
@@ -860,7 +860,7 @@ class CStandardTest {
      */
     @Test
     void testImplicitTrig() {
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.SPLIT_MIX_64);
+        final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
         for (int i = 0; i < 100; i++) {
             final double re = next(rng);
             final double im = next(rng);
@@ -893,7 +893,7 @@ class CStandardTest {
     void testAbs() {
         Assertions.assertEquals(inf, complex(inf, nan).abs());
         Assertions.assertEquals(inf, complex(negInf, nan).abs());
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.XO_RO_SHI_RO_128_PP);
+        final UniformRandomProvider rng = RandomSource.XO_RO_SHI_RO_128_PP.create();
         for (int i = 0; i < 10; i++) {
             final double x = next(rng);
             final double y = next(rng);
diff --git a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java
index 9d7c23a..dd96b09 100644
--- a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java
+++ b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java
@@ -170,7 +170,7 @@ class ComplexTest {
     void testPolarConstructorAbsArg() {
         // The test should work with any seed but use a fixed seed to avoid build
         // instability.
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.SPLIT_MIX_64, 678678638L);
+        final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create(678678638L);
         for (int i = 0; i < 10; i++) {
             final double rho = rng.nextDouble();
             // Range (pi, pi]: lower exclusive, upper inclusive
@@ -203,7 +203,7 @@ class ComplexTest {
                 Assertions.assertEquals(z, Complex.parse(z.toString()));
             }
         }
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.SPLIT_MIX_64);
+        final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
         for (int i = 0; i < 10; i++) {
             final double x = -1 + rng.nextDouble() * 2;
             final double y = -1 + rng.nextDouble() * 2;
@@ -284,7 +284,7 @@ class ComplexTest {
 
     @Test
     void testCGrammar() {
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.SPLIT_MIX_64);
+        final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
         for (int i = 0; i < 10; i++) {
             final Complex z = Complex.ofCartesian(rng.nextDouble(), rng.nextDouble());
             Assertions.assertEquals(z.getReal(), z.real(), "real");
@@ -1414,7 +1414,7 @@ class ComplexTest {
     @Test
     void testLog10() {
         final double ln10 = Math.log(10);
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.SPLIT_MIX_64);
+        final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
         for (int i = 0; i < 10; i++) {
             final Complex z = Complex.ofCartesian(rng.nextDouble() * 2, rng.nextDouble() * 2);
             final Complex lnz = z.log();
@@ -2064,7 +2064,7 @@ class ComplexTest {
      */
     @Test
     void testAbsVsSqrt() {
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.XO_RO_SHI_RO_128_PP);
+        final UniformRandomProvider rng = RandomSource.XO_RO_SHI_RO_128_PP.create();
         // Note: All methods implement scaling to ensure the magnitude can be computed.
         // Try very large or small numbers that will over/underflow to test that the
         // scaling
@@ -2128,7 +2128,7 @@ class ComplexTest {
      */
     @Test
     void testAbsVsLog() {
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.XO_RO_SHI_RO_128_PP);
+        final UniformRandomProvider rng = RandomSource.XO_RO_SHI_RO_128_PP.create();
         // Note: All methods implement scaling to ensure the magnitude can be computed.
         // Try very large or small numbers that will over/underflow to test that the
         // scaling
diff --git a/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/NormTest.java b/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/NormTest.java
index 6c1869c..3c6e4fe 100644
--- a/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/NormTest.java
+++ b/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/NormTest.java
@@ -166,7 +166,7 @@ class NormTest {
     @Test
     void testEuclidean_2d_random() {
         // arrange
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.XO_RO_SHI_RO_1024_PP, 1L);
+        final UniformRandomProvider rng = RandomSource.XO_RO_SHI_RO_1024_PP.create(1L);
 
         // act/assert
         checkEuclideanRandom(2, rng);
@@ -195,7 +195,7 @@ class NormTest {
     void testEuclidean_2d_vsHypot() {
         // arrange
         final int samples = 1000;
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.XO_RO_SHI_RO_1024_PP, 3L);
+        final UniformRandomProvider rng = RandomSource.XO_RO_SHI_RO_1024_PP.create(3L);
 
         // act/assert
         assertEuclidean2dVersusHypot(-10, +10, samples, rng);
@@ -296,7 +296,7 @@ class NormTest {
     @Test
     void testEuclidean_3d_random() {
         // arrange
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.XO_RO_SHI_RO_1024_PP, 1L);
+        final UniformRandomProvider rng = RandomSource.XO_RO_SHI_RO_1024_PP.create(1L);
 
         // act/assert
         checkEuclideanRandom(3, rng);
@@ -378,7 +378,7 @@ class NormTest {
     @Test
     void testEuclidean_array_random() {
         // arrange
-        final UniformRandomProvider rng = RandomSource.create(RandomSource.XO_RO_SHI_RO_1024_PP, 1L);
+        final UniformRandomProvider rng = RandomSource.XO_RO_SHI_RO_1024_PP.create(1L);
 
         // act/assert
         checkEuclideanRandom(2, rng);

[commons-numbers] 01/02: Upgrade parent POM.

Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6251464d735e885e0fa27cd1995210283a13a0ef
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Mon Jan 24 00:01:17 2022 +0100

    Upgrade parent POM.
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 22c0c69..21bc774 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
   <parent>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-parent</artifactId>
-    <version>51</version>
+    <version>52</version>
   </parent>
 
   <artifactId>commons-numbers-parent</artifactId>