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 2021/06/10 16:29:54 UTC

[commons-math] branch master updated (151b015 -> bdc4a52)

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-math.git.


    from 151b015  MATH-1594: Remove "Serializable".
     new ca830af  Remove dependency "ComplexUtils" class.
     new bdc4a52  Remove dependencies on unused "Commons Numbers" modules.

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-math-legacy-core/pom.xml                   |  5 -----
 commons-math-legacy/pom.xml                        | 10 ----------
 .../legacy/analysis/solvers/LaguerreSolver.java    | 23 ++++++++++++++++++----
 pom.xml                                            | 12 -----------
 4 files changed, 19 insertions(+), 31 deletions(-)

[commons-math] 02/02: Remove dependencies on unused "Commons Numbers" modules.

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-math.git

commit bdc4a527fb526da71042b4cbf7acbb9484885c40
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Thu Jun 10 18:27:59 2021 +0200

    Remove dependencies on unused "Commons Numbers" modules.
---
 commons-math-legacy-core/pom.xml |  5 -----
 commons-math-legacy/pom.xml      | 10 ----------
 pom.xml                          | 12 ------------
 3 files changed, 27 deletions(-)

diff --git a/commons-math-legacy-core/pom.xml b/commons-math-legacy-core/pom.xml
index 8b14ff6..01110e6 100644
--- a/commons-math-legacy-core/pom.xml
+++ b/commons-math-legacy-core/pom.xml
@@ -56,11 +56,6 @@
 
     <dependency>
       <groupId>org.apache.commons</groupId>
-      <artifactId>commons-numbers-arrays</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.commons</groupId>
       <artifactId>commons-rng-client-api</artifactId>
     </dependency>
 
diff --git a/commons-math-legacy/pom.xml b/commons-math-legacy/pom.xml
index 975a518..921fc31 100644
--- a/commons-math-legacy/pom.xml
+++ b/commons-math-legacy/pom.xml
@@ -61,11 +61,6 @@
 
     <dependency>
       <groupId>org.apache.commons</groupId>
-      <artifactId>commons-numbers-complex-streams</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.commons</groupId>
       <artifactId>commons-numbers-gamma</artifactId>
     </dependency>
 
@@ -76,11 +71,6 @@
 
     <dependency>
       <groupId>org.apache.commons</groupId>
-      <artifactId>commons-numbers-arrays</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.commons</groupId>
       <artifactId>commons-numbers-angle</artifactId>
     </dependency>
 
diff --git a/pom.xml b/pom.xml
index 42d58b6..a5324be 100644
--- a/pom.xml
+++ b/pom.xml
@@ -180,12 +180,6 @@
 
       <dependency>
         <groupId>org.apache.commons</groupId>
-        <artifactId>commons-numbers-complex-streams</artifactId>
-        <version>${math.commons.numbers.version}</version>
-      </dependency>
-
-      <dependency>
-        <groupId>org.apache.commons</groupId>
         <artifactId>commons-numbers-gamma</artifactId>
         <version>${math.commons.numbers.version}</version>
       </dependency>
@@ -198,12 +192,6 @@
 
       <dependency>
         <groupId>org.apache.commons</groupId>
-        <artifactId>commons-numbers-arrays</artifactId>
-        <version>${math.commons.numbers.version}</version>
-      </dependency>
-
-      <dependency>
-        <groupId>org.apache.commons</groupId>
         <artifactId>commons-numbers-angle</artifactId>
         <version>${math.commons.numbers.version}</version>
       </dependency>

[commons-math] 01/02: Remove dependency "ComplexUtils" class.

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-math.git

commit ca830af17040c243fb853ca47d507bd2e57d1cb6
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Thu Jun 10 18:24:53 2021 +0200

    Remove dependency "ComplexUtils" class.
    
    Class will not be released as of "Commons Numbers" v1.0 (cf. NUMBERS-25).
---
 .../legacy/analysis/solvers/LaguerreSolver.java    | 23 ++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolver.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolver.java
index 0f8b4ad..008e25e 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolver.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/solvers/LaguerreSolver.java
@@ -17,7 +17,6 @@
 package org.apache.commons.math4.legacy.analysis.solvers;
 
 import org.apache.commons.numbers.complex.Complex;
-import org.apache.commons.numbers.complex.streams.ComplexUtils;
 import org.apache.commons.math4.legacy.analysis.polynomials.PolynomialFunction;
 import org.apache.commons.math4.legacy.exception.NoBracketingException;
 import org.apache.commons.math4.legacy.exception.NoDataException;
@@ -147,7 +146,7 @@ public class LaguerreSolver extends AbstractPolynomialSolver {
      * @return the point at which the function value is zero.
      */
     private double laguerre(double lo, double hi) {
-        final Complex c[] = ComplexUtils.real2Complex(getCoefficients());
+        final Complex c[] = real2Complex(getCoefficients());
 
         final Complex initial = Complex.ofCartesian(0.5 * (lo + hi), 0);
         final Complex z = complexSolver.solve(c, initial);
@@ -193,7 +192,7 @@ public class LaguerreSolver extends AbstractPolynomialSolver {
               Double.NEGATIVE_INFINITY,
               Double.POSITIVE_INFINITY,
               initial);
-        return complexSolver.solveAll(ComplexUtils.real2Complex(coefficients),
+        return complexSolver.solveAll(real2Complex(coefficients),
                                       Complex.ofCartesian(initial, 0d));
     }
 
@@ -223,7 +222,7 @@ public class LaguerreSolver extends AbstractPolynomialSolver {
               Double.NEGATIVE_INFINITY,
               Double.POSITIVE_INFINITY,
               initial);
-        return complexSolver.solve(ComplexUtils.real2Complex(coefficients),
+        return complexSolver.solve(real2Complex(coefficients),
                                    Complex.ofCartesian(initial, 0d));
     }
 
@@ -381,4 +380,20 @@ public class LaguerreSolver extends AbstractPolynomialSolver {
             }
         }
     }
+
+    /**
+     * Converts a {@code double[]} array to a {@code Complex[]} array.
+     *
+     * @param real array of numbers to be converted to their {@code Complex} equivalent
+     * @return {@code Complex} array
+     */
+    private static Complex[] real2Complex(double[] real) {
+        int index = 0;
+        final Complex[] c = new Complex[real.length];
+        for (final double d : real) {
+            c[index] = Complex.ofCartesian(d, 0);
+            index++;
+        }
+        return c;
+    }
 }