commons-numbers git commit: NUMBERS-71: Complex multiplication and division methods have implemented C++11 standards.

2018-03-13 Thread ericbarnhill
Repository: commons-numbers
Updated Branches:
  refs/heads/master 2f23f3e17 -> 84821835d


NUMBERS-71: Complex multiplication and division methods have implemented
C++11 standards.

Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/84821835
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/84821835
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/84821835

Branch: refs/heads/master
Commit: 84821835de201e2fc90c5a362a9bd8fdfcb15079
Parents: 2f23f3e
Author: Eric Barnhill 
Authored: Tue Mar 13 10:48:58 2018 +0100
Committer: Eric Barnhill 
Committed: Tue Mar 13 10:48:58 2018 +0100

--
 .../apache/commons/numbers/complex/Complex.java | 141 +++
 .../commons/numbers/complex/ComplexTest.java|   7 +-
 2 files changed, 86 insertions(+), 62 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/84821835/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
--
diff --git 
a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
 
b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
index c36bea1..f1991e8 100644
--- 
a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
+++ 
b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
@@ -265,60 +265,53 @@ public class Complex implements Serializable  {
  *c + di c2 + d2
  *  
  * 
- * but uses
- * http://doi.acm.org/10.1145/1039813.1039814;>
- * prescaling of operands to limit the effects of overflows and
- * underflows in the computation.
- * 
- * {@code Infinite} and {@code NaN} values are handled according to the
- * following rules, applied in the order presented:
- * 
- *  If {@code divisor} equals {@link #ZERO}, {@link #NAN} is returned.
- *  
- *  If {@code this} and {@code divisor} are both infinite,
- *   {@link #NAN} is returned.
- *  
- *  If {@code this} is finite (i.e., has no {@code Infinite} or
- *   {@code NaN} parts) and {@code divisor} is infinite (one or both parts
- *   infinite), {@link #ZERO} is returned.
- *  
- *  If {@code this} is infinite and {@code divisor} is finite,
- *   {@code NaN} values are returned in the parts of the result if the
- *   {@link java.lang.Double} rules applied to the definitional formula
- *   force {@code NaN} results.
- *  
- * 
+ *
+ *
+ * Recalculates to recover infinities as specified in C.99
+ * standard G.5.1. Method is fully in accordance with
+ * C++11 standards for complex numbers.
  *
  * @param divisor Value by which this {@code Complex} is to be divided.
  * @return {@code this / divisor}.
  */
 public Complex divide(Complex divisor) {
 
-final double c = divisor.real;
-final double d = divisor.imaginary;
-if (c == 0 &&
-d == 0) {
-return NAN;
+double a = real;
+double b = imaginary;
+double c = divisor.getReal();
+double d = divisor.getImaginary();
+int ilogbw = 0;
+double logbw = Math.log(Math.max(Math.abs(c), Math.abs(d))) / 
Math.log(2);
+if (!Double.isInfinite(logbw)) {
+   ilogbw = (int)logbw;
+   c = Math.scalb(c, -ilogbw);
+   d = Math.scalb(d, -ilogbw);
 }
-
-if ((Double.isInfinite(c) ||
- Double.isInfinite(d)) &&
-(Double.isInfinite(real) ||
- Double.isInfinite(imaginary))) {
-return ZERO;
+double denom = c*c + d*d;
+double x = Math.scalb( (a*c + b*d) / denom, -ilogbw);
+double y = Math.scalb( (b*c - a*d) / denom, -ilogbw);
+if (Double.isNaN(x) && Double.isNaN(y)) {
+   if ((denom == 0.0) &&
+   (!Double.isNaN(a) || !Double.isNaN(b))) {
+   x = Math.copySign(Double.POSITIVE_INFINITY, c) * a;
+   y = Math.copySign(Double.POSITIVE_INFINITY, c) * b;
+   } else if ((Double.isInfinite(a) && Double.isInfinite(b)) &&
+   !Double.isInfinite(c) & !Double.isInfinite(d)) {
+   a = Math.copySign(Double.isInfinite(a) ? 1.0 : 0.0, a);
+   b = Math.copySign(Double.isInfinite(b) ? 1.0 : 0.0, b);
+   x = Double.POSITIVE_INFINITY * (a*c + b*d);
+   y = Double.POSITIVE_INFINITY * (b*c - a*d);
+   } else if (Double.isInfinite(logbw) &&
+

commons-numbers git commit: Clean checkstyle for Complex

2018-03-13 Thread ericbarnhill
Repository: commons-numbers
Updated Branches:
  refs/heads/master 84821835d -> 8a1f45e1b


Clean checkstyle for Complex

Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/8a1f45e1
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/8a1f45e1
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/8a1f45e1

Branch: refs/heads/master
Commit: 8a1f45e1b7582c04b6296958cf191c59eedbc721
Parents: 8482183
Author: Eric Barnhill 
Authored: Tue Mar 13 11:37:33 2018 +0100
Committer: Eric Barnhill 
Committed: Tue Mar 13 11:37:33 2018 +0100

--
 .../apache/commons/numbers/complex/Complex.java | 132 +++
 .../commons/numbers/complex/RootsOfUnity.java   |   4 +-
 2 files changed, 80 insertions(+), 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/8a1f45e1/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
--
diff --git 
a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
 
b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
index f1991e8..3a7fd21 100644
--- 
a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
+++ 
b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
@@ -45,10 +45,6 @@ import org.apache.commons.numbers.core.Precision;
  *
  */
 public class Complex implements Serializable  {
-/** Serializable version identifier. */
-private static final long serialVersionUID = 20180201L;
-/** A complex number representing "NaN + NaN i" */
-private static final Complex NAN = new Complex(Double.NaN, Double.NaN);
 /** The square root of -1, a.k.a. "i". */
 public static final Complex I = new Complex(0, 1);
 /** A complex number representing "+INF + INF i" */
@@ -56,13 +52,23 @@ public class Complex implements Serializable  {
 /** A complex number representing one. */
 public static final Complex ONE = new Complex(1, 0);
 /** A complex number representing zero. */
-public static final Complex ZERO = new Complex(0, 0);
+public static final Complex ZERO = new Complex(0, 0);/** Serializable 
version identifier. */
+private static final long serialVersionUID = 20180201L;
+/** A complex number representing "NaN + NaN i" */
+private static final Complex NAN = new Complex(Double.NaN, Double.NaN);
+
 
 /** The imaginary part. */
 private final double imaginary;
 /** The real part. */
 private final double real;
 
+/**
+ * Private default constructor.
+ *
+ * @param real Real part.
+ * @param imaginary Imaginary part.
+ */
 private Complex(double real, double imaginary) {
 this.real = real;
 this.imaginary = imaginary;
@@ -73,18 +79,20 @@ public class Complex implements Serializable  {
 *
 * @param real Real part.
 * @param imaginary Imaginary part.
+* @return {@code Complex} object
 */
 public static Complex ofCartesian(double real, double imaginary) {
-   return new Complex(real, imaginary);
+return new Complex(real, imaginary);
 }
 
 /**
 * Create a complex number given the real part.
 *
 * @param real Real part.
+* @return {@code Complex} object
 */
 public static Complex ofCartesian(double real) {
-   return new Complex(real, 0);
+return new Complex(real, 0);
 }
 
  /**
@@ -283,31 +291,31 @@ public class Complex implements Serializable  {
 int ilogbw = 0;
 double logbw = Math.log(Math.max(Math.abs(c), Math.abs(d))) / 
Math.log(2);
 if (!Double.isInfinite(logbw)) {
-   ilogbw = (int)logbw;
-   c = Math.scalb(c, -ilogbw);
-   d = Math.scalb(d, -ilogbw);
+ilogbw = (int)logbw;
+c = Math.scalb(c, -ilogbw);
+d = Math.scalb(d, -ilogbw);
 }
 double denom = c*c + d*d;
 double x = Math.scalb( (a*c + b*d) / denom, -ilogbw);
 double y = Math.scalb( (b*c - a*d) / denom, -ilogbw);
 if (Double.isNaN(x) && Double.isNaN(y)) {
-   if ((denom == 0.0) &&
-   (!Double.isNaN(a) || !Double.isNaN(b))) {
-   x = Math.copySign(Double.POSITIVE_INFINITY, c) * a;
-   y = Math.copySign(Double.POSITIVE_INFINITY, c) * b;
-   } else if ((Double.isInfinite(a) && Double.isInfinite(b)) &&
-   !Double.isInfinite(c) & !Double.isInfinite(d)) {
-   a = Math.copySign(Double.isInfinite(a) ? 1.0 : 0.0, a);
- 

svn commit: r1826637 - /commons/proper/validator/trunk/src/changes/changes.xml

2018-03-13 Thread ggregory
Author: ggregory
Date: Tue Mar 13 14:25:32 2018
New Revision: 1826637

URL: http://svn.apache.org/viewvc?rev=1826637=rev
Log:
[VALIDATOR-437] Update Apache Commons BeanUtils dependency from 1.9.2 to 1.9.3. 
This picks up [BEANUTILS-482]: Update commons-collections from 3.2.1 to 3.2.2 
(CVE-2015-4852).

Modified:
commons/proper/validator/trunk/src/changes/changes.xml

Modified: commons/proper/validator/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1826637=1826636=1826637=diff
==
--- commons/proper/validator/trunk/src/changes/changes.xml (original)
+++ commons/proper/validator/trunk/src/changes/changes.xml Tue Mar 13 14:25:32 
2018
@@ -92,7 +92,8 @@ Apache Commons Validator.
  DEPENDENCIES
  
 
-The dependencies for Validator have not changed since the 1.4 release.
+ *   Updates Apache Commons BeanUtils dependency from 1.9.2 to 1.9.3.
+ This picks up BEANUTILS-482: Update commons-collections from 3.2.1 to 
3.2.2 (CVE-2015-4852).
 
 For the current list of dependencies, please see
 http://commons.apache.org/validator/dependencies.html




svn commit: r1826636 - in /commons/proper/validator/trunk: pom.xml src/changes/changes.xml

2018-03-13 Thread ggregory
Author: ggregory
Date: Tue Mar 13 14:23:08 2018
New Revision: 1826636

URL: http://svn.apache.org/viewvc?rev=1826636=rev
Log:
[VALIDATOR-437] Update Apache Commons BeanUtils dependency from 1.9.2 to 1.9.3. 
This picks up [BEANUTILS-482]: Update commons-collections from 3.2.1 to 3.2.2 
(CVE-2015-4852).

Modified:
commons/proper/validator/trunk/pom.xml
commons/proper/validator/trunk/src/changes/changes.xml

Modified: commons/proper/validator/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/validator/trunk/pom.xml?rev=1826636=1826635=1826636=diff
==
--- commons/proper/validator/trunk/pom.xml (original)
+++ commons/proper/validator/trunk/pom.xml Tue Mar 13 14:23:08 2018
@@ -211,7 +211,7 @@
 
   commons-beanutils
   commons-beanutils
-  1.9.2
+  1.9.3
 
 
 

Modified: commons/proper/validator/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1826636=1826635=1826636=diff
==
--- commons/proper/validator/trunk/src/changes/changes.xml (original)
+++ commons/proper/validator/trunk/src/changes/changes.xml Tue Mar 13 14:23:08 
2018
@@ -106,6 +106,10 @@ http://commons.apache.org/validator/depe
 
 Field does not synchronize iteration on synchronized list
 
+
+Update Apache Commons BeanUtils dependency from 1.9.2 to 1.9.3.
+This picks up BEANUTILS-482: Update commons-collections from 3.2.1 to 
3.2.2 (CVE-2015-4852).
+
   
 
   

Nexus: Staging Repository Dropped

2018-03-13 Thread Nexus Repository Manager
Message from: https://repository.apache.orgDescription:Scheduled task 'Drop Idle Closed Repos' has dropped repositoryDeployer properties:"userAgent" = "Apache-Maven/3.5.0 (Java 1.8.0_151; Linux 4.13.0-16-generic)""userId" = "rmannibucau""ip" = "84.14.92.154"Details:The orgapachecommons-1298 staging repository has been dropped.