commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1538368 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math3/dfp/ main/java/org/apache/commons/math3/distribution/ main/java/org/apache/commons/math3/fitting/leastsquares/ main/java/org/apache/commons/math3/fraction/ mai...
Date Sun, 03 Nov 2013 13:57:38 GMT
Author: erans
Date: Sun Nov  3 13:57:37 2013
New Revision: 1538368

URL: http://svn.apache.org/r1538368
Log:
MATH-1054
Standardize "x = x op y" to "x op= y". Thanks to Sean Owen.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/Dfp.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/DfpField.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/DfpMath.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/PoissonDistribution.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/SaddlePointExpansion.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fraction/BigFraction.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fraction/ProperFractionFormat.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/partitioning/utilities/OrderedTuple.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayFieldVector.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayRealVector.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/HessenbergTransformer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SchurTransformer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SingularValueDecomposition.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/nonlinear/vector/jacobian/LevenbergMarquardtOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/general/LevenbergMarquardtOptimizer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/PollardRho.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/Primes.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/SmallPrimes.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/AbstractRandomGenerator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/BitsStreamGenerator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/SobolSequenceGenerator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/StableRandomGenerator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/Well19937c.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/Well44497b.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Erf.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/regression/MillerUpdatingRegression.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Combinations.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/FastMath.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/FastMathCalc.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/clustering/KMeansPlusPlusClustererTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/PrecisionTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/Dfp.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/Dfp.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/Dfp.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/Dfp.java Sun Nov  3 13:57:37 2013
@@ -1242,7 +1242,7 @@ public class Dfp implements RealFieldEle
         }
 
         int rh = extra / RADIX;
-        extra = extra - rh * RADIX;
+        extra -= rh * RADIX;
         for (int i = 0; i < mant.length; i++) {
             final int r = mant[i] + rh;
             rh = r / RADIX;
@@ -1557,7 +1557,7 @@ public class Dfp implements RealFieldEle
             int rh = 0;  // acts as a carry
             for (int j=0; j<mant.length; j++) {
                 int r = mant[i] * x.mant[j];    // multiply the 2 digits
-                r = r + product[i+j] + rh;  // add to the product digit with carry in
+                r += product[i+j] + rh;  // add to the product digit with carry in
 
                 rh = r / RADIX;
                 product[i+j] = r - rh * RADIX;
@@ -1806,7 +1806,7 @@ public class Dfp implements RealFieldEle
 
                 /* find out how far off the remainder is telling us we are */
                 minadj = (remainder[mant.length] * RADIX)+remainder[mant.length-1];
-                minadj = minadj / (divisor.mant[mant.length-1]+1);
+                minadj /= (divisor.mant[mant.length-1]+1);
 
                 if (minadj >= 2) {
                     min = trial+minadj;  // update the minimum
@@ -2154,8 +2154,8 @@ public class Dfp implements RealFieldEle
 
         while (p > 0) {
             outputbuffer[q++] = (char)(ae / p + '0');
-            ae = ae % p;
-            p = p / 10;
+            ae %= p;
+            p /= 10;
         }
 
         return new String(outputbuffer, 0, q);
@@ -2284,11 +2284,11 @@ public class Dfp implements RealFieldEle
                 } else {
                     def = newInstance(result);  // gradual underflow
                 }
-                result.exp = result.exp + ERR_SCALE;
+                result.exp += ERR_SCALE;
                 break;
 
             case DfpField.FLAG_OVERFLOW:
-                result.exp = result.exp - ERR_SCALE;
+                result.exp -= ERR_SCALE;
                 def = newInstance(getZero());
                 def.sign = result.sign;
                 def.nans = INFINITE;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/DfpField.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/DfpField.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/DfpField.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/DfpField.java Sun Nov  3 13:57:37 2013
@@ -742,7 +742,7 @@ public class DfpField implements Field<D
         for (int i = 0; i < 10000; i++) {
             num = num.multiply(x);
             num = num.multiply(x);
-            den = den + 2;
+            den += 2;
             Dfp t = num.divide(den);
             y = y.add(t);
             if (y.equals(py)) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/DfpMath.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/DfpMath.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/DfpMath.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/dfp/DfpMath.java Sun Nov  3 13:57:37 2013
@@ -179,7 +179,7 @@ public class DfpMath {
             int prevtrial;
             while (true) {
                 prevtrial = trial;
-                trial = trial * 2;
+                trial *= 2;
                 if (trial > a) {
                     break;
                 }
@@ -235,13 +235,13 @@ public class DfpMath {
                 prevr = new Dfp(r);
                 prevtrial = trial;
                 r = r.multiply(r);
-                trial = trial * 2;
+                trial *= 2;
             } while (a>trial);
 
             r = prevr;
             trial = prevtrial;
 
-            a = a - trial;
+            a -= trial;
             result = result.multiply(r);
 
         } while (a >= 1);
@@ -447,7 +447,7 @@ public class DfpMath {
         for (int i = 0; i < 10000; i++) {
             num = num.multiply(x);
             num = num.multiply(x);
-            den = den + 2;
+            den += 2;
             t = num.divide(den);
             y = y.add(t);
             if (y.equals(py)) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/PoissonDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/PoissonDistribution.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/PoissonDistribution.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/PoissonDistribution.java Sun Nov  3 13:57:37 2013
@@ -304,7 +304,7 @@ public class PoissonDistribution extends
 
             while (n < 1000 * meanPoisson) {
                 rnd = random.nextDouble();
-                r = r * rnd;
+                r *= rnd;
                 if (r >= p) {
                     n++;
                 } else {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/SaddlePointExpansion.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/SaddlePointExpansion.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/SaddlePointExpansion.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/distribution/SaddlePointExpansion.java Sun Nov  3 13:57:37 2013
@@ -150,7 +150,7 @@ final class SaddlePointExpansion {
             double s1 = v * d;
             double s = Double.NaN;
             double ej = 2.0 * x * v;
-            v = v * v;
+            v *= v;
             int j = 1;
             while (s1 != s) {
                 s = s1;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java Sun Nov  3 13:57:37 2013
@@ -460,7 +460,7 @@ public class LevenbergMarquardtOptimizer
                     coeff1 += work1[j] * work1[j];
                 }
                 double pc2 = previousCost * previousCost;
-                coeff1 = coeff1 / pc2;
+                coeff1 /= pc2;
                 double coeff2 = lmPar * lmNorm * lmNorm / pc2;
                 double preRed = coeff1 + 2 * coeff2;
                 double dirDer = -(coeff1 + coeff2);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fraction/BigFraction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fraction/BigFraction.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fraction/BigFraction.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fraction/BigFraction.java Sun Nov  3 13:57:37 2013
@@ -191,7 +191,7 @@ public class BigFraction
         }
         int k = ((int) (exponent >> 52)) - 1075;
         while (((m & 0x001ffffffffffffeL) != 0) && ((m & 0x1) == 0)) {
-            m = m >> 1;
+            m >>= 1;
             ++k;
         }
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fraction/ProperFractionFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fraction/ProperFractionFormat.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fraction/ProperFractionFormat.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/fraction/ProperFractionFormat.java Sun Nov  3 13:57:37 2013
@@ -96,7 +96,7 @@ public class ProperFractionFormat extend
         int num = fraction.getNumerator();
         int den = fraction.getDenominator();
         int whole = num / den;
-        num = num % den;
+        num %= den;
 
         if (whole != 0) {
             getWholeFormat().format(whole, toAppendTo, pos);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/partitioning/utilities/OrderedTuple.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/partitioning/utilities/OrderedTuple.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/partitioning/utilities/OrderedTuple.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/partitioning/utilities/OrderedTuple.java Sun Nov  3 13:57:37 2013
@@ -369,10 +369,10 @@ public class OrderedTuple implements Com
         while (scale != 0) {
             if ((ll & mask) != ll) {
                 msb |= scale;
-                ll = ll >> scale;
+                ll >>= scale;
             }
-            scale = scale >> 1;
-            mask  = mask >> scale;
+            scale >>= 1;
+            mask >>= scale;
         }
 
         return msb;
@@ -395,10 +395,10 @@ public class OrderedTuple implements Com
         while (scale != 0) {
             if ((ll & mask) == ll) {
                 lsb |= scale;
-                ll = ll >> scale;
+                ll >>= scale;
             }
-            scale = scale >> 1;
-            mask  = mask >> scale;
+            scale >>= 1;
+            mask >>= scale;
         }
 
         return lsb;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayFieldVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayFieldVector.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayFieldVector.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayFieldVector.java Sun Nov  3 13:57:37 2013
@@ -940,7 +940,7 @@ public class ArrayFieldVector<T extends 
     public int hashCode() {
         int h = 3542;
         for (final T a : data) {
-            h = h ^ a.hashCode();
+            h ^= a.hashCode();
         }
         return h;
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayRealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayRealVector.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayRealVector.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayRealVector.java Sun Nov  3 13:57:37 2013
@@ -360,7 +360,7 @@ public class ArrayRealVector extends Rea
     @Override
     public RealVector mapAddToSelf(double d) {
         for (int i = 0; i < data.length; i++) {
-            data[i] = data[i] + d;
+            data[i] += d;
         }
         return this;
     }
@@ -369,7 +369,7 @@ public class ArrayRealVector extends Rea
     @Override
     public RealVector mapSubtractToSelf(double d) {
         for (int i = 0; i < data.length; i++) {
-            data[i] = data[i] - d;
+            data[i] -= d;
         }
         return this;
     }
@@ -378,7 +378,7 @@ public class ArrayRealVector extends Rea
     @Override
     public RealVector mapMultiplyToSelf(double d) {
         for (int i = 0; i < data.length; i++) {
-            data[i] = data[i] * d;
+            data[i] *= d;
         }
         return this;
     }
@@ -387,7 +387,7 @@ public class ArrayRealVector extends Rea
     @Override
     public RealVector mapDivideToSelf(double d) {
         for (int i = 0; i < data.length; i++) {
-            data[i] = data[i] / d;
+            data[i] /= d;
         }
         return this;
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/EigenDecomposition.java Sun Nov  3 13:57:37 2013
@@ -661,13 +661,13 @@ public class EigenDecomposition {
                             t = FastMath.sqrt(c * c + 1.0);
                             e[i + 1] = p * t;
                             s = 1.0 / t;
-                            c = c * s;
+                            c *= s;
                         } else {
                             s = p / q;
                             t = FastMath.sqrt(s * s + 1.0);
                             e[i + 1] = q * t;
                             c = 1.0 / t;
-                            s = s * c;
+                            s *= c;
                         }
                         if (e[i + 1] == 0.0) {
                             realEigenvalues[i + 1] -= u;
@@ -803,7 +803,7 @@ public class EigenDecomposition {
         double norm = 0.0;
         for (int i = 0; i < n; i++) {
            for (int j = FastMath.max(i - 1, 0); j < n; j++) {
-              norm = norm + FastMath.abs(matrixT[i][j]);
+               norm += FastMath.abs(matrixT[i][j]);
            }
         }
 
@@ -830,7 +830,7 @@ public class EigenDecomposition {
                     double w = matrixT[i][i] - p;
                     r = 0.0;
                     for (int j = l; j <= idx; j++) {
-                        r = r + matrixT[i][j] * matrixT[j][idx];
+                        r += matrixT[i][j] * matrixT[j][idx];
                     }
                     if (Precision.compareTo(imagEigenvalues[i], 0.0, EPSILON) < 0) {
                         z = w;
@@ -862,7 +862,7 @@ public class EigenDecomposition {
                         double t = FastMath.abs(matrixT[i][idx]);
                         if ((Precision.EPSILON * t) * t > 1) {
                             for (int j = i; j <= idx; j++) {
-                                matrixT[j][idx] = matrixT[j][idx] / t;
+                                matrixT[j][idx] /= t;
                             }
                         }
                     }
@@ -889,8 +889,8 @@ public class EigenDecomposition {
                     double ra = 0.0;
                     double sa = 0.0;
                     for (int j = l; j <= idx; j++) {
-                        ra = ra + matrixT[i][j] * matrixT[j][idx - 1];
-                        sa = sa + matrixT[i][j] * matrixT[j][idx];
+                        ra += matrixT[i][j] * matrixT[j][idx - 1];
+                        sa += matrixT[i][j] * matrixT[j][idx];
                     }
                     double w = matrixT[i][i] - p;
 
@@ -939,8 +939,8 @@ public class EigenDecomposition {
                                                 FastMath.abs(matrixT[i][idx]));
                         if ((Precision.EPSILON * t) * t > 1) {
                             for (int j = i; j <= idx; j++) {
-                                matrixT[j][idx - 1] = matrixT[j][idx - 1] / t;
-                                matrixT[j][idx]     = matrixT[j][idx] / t;
+                                matrixT[j][idx - 1] /= t;
+                                matrixT[j][idx] /= t;
                             }
                         }
                     }
@@ -953,7 +953,7 @@ public class EigenDecomposition {
             for (int i = 0; i <= n - 1; i++) {
                 z = 0.0;
                 for (int k = 0; k <= FastMath.min(j, n - 1); k++) {
-                    z = z + matrixP[i][k] * matrixT[k][j];
+                    z += matrixP[i][k] * matrixT[k][j];
                 }
                 matrixP[i][j] = z;
             }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/HessenbergTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/HessenbergTransformer.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/HessenbergTransformer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/HessenbergTransformer.java Sun Nov  3 13:57:37 2013
@@ -197,8 +197,8 @@ class HessenbergTransformer {
                 }
                 final double g = (ort[m] > 0) ? -FastMath.sqrt(h) : FastMath.sqrt(h);
 
-                h = h - ort[m] * g;
-                ort[m] = ort[m] - g;
+                h -= ort[m] * g;
+                ort[m] -= g;
 
                 // Apply Householder similarity transformation
                 // H = (I - u*u' / h) * H * (I - u*u' / h)
@@ -208,7 +208,7 @@ class HessenbergTransformer {
                     for (int i = high; i >= m; i--) {
                         f += ort[i] * householderVectors[i][j];
                     }
-                    f = f / h;
+                    f /= h;
                     for (int i = m; i <= high; i++) {
                         householderVectors[i][j] -= f * ort[i];
                     }
@@ -219,7 +219,7 @@ class HessenbergTransformer {
                     for (int j = high; j >= m; j--) {
                         f += ort[j] * householderVectors[i][j];
                     }
-                    f = f / h;
+                    f /= h;
                     for (int j = m; j <= high; j++) {
                         householderVectors[i][j] -= f * ort[j];
                     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SchurTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SchurTransformer.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SchurTransformer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SchurTransformer.java Sun Nov  3 13:57:37 2013
@@ -149,7 +149,7 @@ class SchurTransformer {
             // Check for convergence
             if (il == iu) {
                 // One root found
-                matrixT[iu][iu] = matrixT[iu][iu] + shift.exShift;
+                matrixT[iu][iu] += shift.exShift;
                 iu--;
                 iteration = 0;
             } else if (il == iu - 1) {
@@ -171,8 +171,8 @@ class SchurTransformer {
                     p = x / s;
                     q = z / s;
                     final double r = FastMath.sqrt(p * p + q * q);
-                    p = p / r;
-                    q = q / r;
+                    p /= r;
+                    q /= r;
 
                     // Row modification
                     for (int j = iu - 1; j < n; j++) {
@@ -367,9 +367,9 @@ class SchurTransformer {
                 if (Precision.equals(shift.x, 0.0, epsilon)) {
                     continue;
                 }
-                p = p / shift.x;
-                q = q / shift.x;
-                r = r / shift.x;
+                p /= shift.x;
+                q /= shift.x;
+                r /= shift.x;
             }
             double s = FastMath.sqrt(p * p + q * q + r * r);
             if (p < 0.0) {
@@ -381,33 +381,33 @@ class SchurTransformer {
                 } else if (il != im) {
                     matrixT[k][k - 1] = -matrixT[k][k - 1];
                 }
-                p = p + s;
+                p += s;
                 shift.x = p / s;
                 shift.y = q / s;
                 double z = r / s;
-                q = q / p;
-                r = r / p;
+                q /= p;
+                r /= p;
 
                 // Row modification
                 for (int j = k; j < n; j++) {
                     p = matrixT[k][j] + q * matrixT[k + 1][j];
                     if (notlast) {
-                        p = p + r * matrixT[k + 2][j];
-                        matrixT[k + 2][j] = matrixT[k + 2][j] - p * z;
+                        p += r * matrixT[k + 2][j];
+                        matrixT[k + 2][j] -= p * z;
                     }
-                    matrixT[k][j] = matrixT[k][j] - p * shift.x;
-                    matrixT[k + 1][j] = matrixT[k + 1][j] - p * shift.y;
+                    matrixT[k][j] -= p * shift.x;
+                    matrixT[k + 1][j] -= p * shift.y;
                 }
 
                 // Column modification
                 for (int i = 0; i <= FastMath.min(iu, k + 3); i++) {
                     p = shift.x * matrixT[i][k] + shift.y * matrixT[i][k + 1];
                     if (notlast) {
-                        p = p + z * matrixT[i][k + 2];
-                        matrixT[i][k + 2] = matrixT[i][k + 2] - p * r;
+                        p += z * matrixT[i][k + 2];
+                        matrixT[i][k + 2] -= p * r;
                     }
-                    matrixT[i][k] = matrixT[i][k] - p;
-                    matrixT[i][k + 1] = matrixT[i][k + 1] - p * q;
+                    matrixT[i][k] -= p;
+                    matrixT[i][k + 1] -= p * q;
                 }
 
                 // Accumulate transformations
@@ -415,11 +415,11 @@ class SchurTransformer {
                 for (int i = 0; i <= high; i++) {
                     p = shift.x * matrixP[i][k] + shift.y * matrixP[i][k + 1];
                     if (notlast) {
-                        p = p + z * matrixP[i][k + 2];
-                        matrixP[i][k + 2] = matrixP[i][k + 2] - p * r;
+                        p += z * matrixP[i][k + 2];
+                        matrixP[i][k + 2] -= p * r;
                     }
-                    matrixP[i][k] = matrixP[i][k] - p;
-                    matrixP[i][k + 1] = matrixP[i][k + 1] - p * q;
+                    matrixP[i][k] -= p;
+                    matrixP[i][k + 1] -= p * q;
                 }
             }  // (s != 0)
         }  // k loop

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SingularValueDecomposition.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SingularValueDecomposition.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SingularValueDecomposition.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/SingularValueDecomposition.java Sun Nov  3 13:57:37 2013
@@ -430,7 +430,7 @@ public class SingularValueDecomposition 
                         }
                     }
                     e[p - 2] = f;
-                    iter = iter + 1;
+                    iter++;
                 }
                 break;
                 // Convergence.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java Sun Nov  3 13:57:37 2013
@@ -492,11 +492,11 @@ public class CMAESOptimizer
             }
             // Adjust step size in case of equal function values (flat fitness)
             if (bestValue == fitness[arindex[(int)(0.1+lambda/4.)]]) {
-                sigma = sigma * Math.exp(0.2 + cs / damps);
+                sigma *= Math.exp(0.2 + cs / damps);
             }
             if (iterations > 2 && Math.max(historyWorst, bestFitness) -
                 Math.min(historyBest, bestFitness) == 0) {
-                sigma = sigma * Math.exp(0.2 + cs / damps);
+                sigma *= Math.exp(0.2 + cs / damps);
             }
             // store best in history
             push(fitnessHistory,bestFitness);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/nonlinear/vector/jacobian/LevenbergMarquardtOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/nonlinear/vector/jacobian/LevenbergMarquardtOptimizer.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/nonlinear/vector/jacobian/LevenbergMarquardtOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optim/nonlinear/vector/jacobian/LevenbergMarquardtOptimizer.java Sun Nov  3 13:57:37 2013
@@ -457,7 +457,7 @@ public class LevenbergMarquardtOptimizer
                     coeff1 += work1[j] * work1[j];
                 }
                 double pc2 = previousCost * previousCost;
-                coeff1 = coeff1 / pc2;
+                coeff1 /= pc2;
                 double coeff2 = lmPar * lmNorm * lmNorm / pc2;
                 double preRed = coeff1 + 2 * coeff2;
                 double dirDer = -(coeff1 + coeff2);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java Sun Nov  3 13:57:37 2013
@@ -620,11 +620,11 @@ public class CMAESOptimizer
             }
             // Adjust step size in case of equal function values (flat fitness)
             if (bestValue == fitness[arindex[(int)(0.1+lambda/4.)]]) {
-                sigma = sigma * Math.exp(0.2 + cs / damps);
+                sigma *= Math.exp(0.2 + cs / damps);
             }
             if (iterations > 2 && Math.max(historyWorst, bestFitness) -
                 Math.min(historyBest, bestFitness) == 0) {
-                sigma = sigma * Math.exp(0.2 + cs / damps);
+                sigma *= Math.exp(0.2 + cs / damps);
             }
             // store best in history
             push(fitnessHistory,bestFitness);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/general/LevenbergMarquardtOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/general/LevenbergMarquardtOptimizer.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/general/LevenbergMarquardtOptimizer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/general/LevenbergMarquardtOptimizer.java Sun Nov  3 13:57:37 2013
@@ -446,7 +446,7 @@ public class LevenbergMarquardtOptimizer
                     coeff1 += work1[j] * work1[j];
                 }
                 double pc2 = previousCost * previousCost;
-                coeff1 = coeff1 / pc2;
+                coeff1 /= pc2;
                 double coeff2 = lmPar * lmNorm * lmNorm / pc2;
                 double preRed = coeff1 + 2 * coeff2;
                 double dirDer = -(coeff1 + coeff2);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/PollardRho.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/PollardRho.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/PollardRho.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/PollardRho.java Sun Nov  3 13:57:37 2013
@@ -107,7 +107,7 @@ class PollardRho {
                 if (1 != out) {
                     return out;
                 }
-                k = k + m;
+                k += m;
             } while (k < r);
             r = 2 * r;
         } while (true);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/Primes.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/Primes.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/Primes.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/Primes.java Sun Nov  3 13:57:37 2013
@@ -78,7 +78,7 @@ public class Primes {
         if (n == 2) {
             return 2;
         }
-        n = n | 1;//make sure n is odd
+        n |= 1;//make sure n is odd
         if (n == 1) {
             return 2;
         }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/SmallPrimes.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/SmallPrimes.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/SmallPrimes.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/primes/SmallPrimes.java Sun Nov  3 13:57:37 2013
@@ -83,7 +83,7 @@ class SmallPrimes {
     public static int smallTrialDivision(int n, final List<Integer> factors) {
         for (int p : PRIMES) {
             while (0 == n % p) {
-                n = n / p;
+                n /= p;
                 factors.add(p);
             }
         }
@@ -102,13 +102,13 @@ class SmallPrimes {
         // no check is done about n >= f
         while (f <= maxFactor) {
             if (0 == n % f) {
-                n = n / f;
+                n /= f;
                 factors.add(f);
                 break;
             }
             f += 4;
             if (0 == n % f) {
-                n = n / f;
+                n /= f;
                 factors.add(f);
                 break;
             }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/AbstractRandomGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/AbstractRandomGenerator.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/AbstractRandomGenerator.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/AbstractRandomGenerator.java Sun Nov  3 13:57:37 2013
@@ -109,7 +109,7 @@ public abstract class AbstractRandomGene
           int randInt = nextInt();
           for (int i = 0; i < 3; i++) {
               if ( i > 0) {
-                  randInt = randInt >> 8;
+                  randInt >>= 8;
               }
               bytes[bytesOut++] = (byte) randInt;
               if (bytesOut == bytes.length) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/BitsStreamGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/BitsStreamGenerator.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/BitsStreamGenerator.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/BitsStreamGenerator.java Sun Nov  3 13:57:37 2013
@@ -81,7 +81,7 @@ public abstract class BitsStreamGenerato
         int random = next(32);
         while (i < bytes.length) {
             bytes[i++] = (byte) (random & 0xff);
-            random     = random >> 8;
+            random >>= 8;
         }
     }
 
@@ -179,7 +179,7 @@ public abstract class BitsStreamGenerato
             long val;
             do {
                 bits = ((long) next(31)) << 32;
-                bits = bits | (((long) next(32)) & 0xffffffffL);
+                bits |= ((long) next(32)) & 0xffffffffL;
                 val  = bits % n;
             } while (bits - val + (n - 1) < 0);
             return val;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/RandomDataGenerator.java Sun Nov  3 13:57:37 2013
@@ -248,7 +248,7 @@ public class RandomDataGenerator impleme
                 for (final byte b : byteArray) {
                     bits = (bits << 8) | (((long) b) & 0xffL);
                 }
-                bits = bits & 0x7fffffffffffffffL;
+                bits &= 0x7fffffffffffffffL;
                 val  = bits % n;
             } while (bits - val + (n - 1) < 0);
             return val;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/SobolSequenceGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/SobolSequenceGenerator.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/SobolSequenceGenerator.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/SobolSequenceGenerator.java Sun Nov  3 13:57:37 2013
@@ -271,7 +271,7 @@ public class SobolSequenceGenerator impl
         }
 
         for (int i = 0; i < dimension; i++) {
-            x[i] = x[i] ^ direction[i][c];
+            x[i] ^= direction[i][c];
             v[i] = (double) x[i] / SCALE;
         }
         count++;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/StableRandomGenerator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/StableRandomGenerator.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/StableRandomGenerator.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/StableRandomGenerator.java Sun Nov  3 13:57:37 2013
@@ -126,7 +126,7 @@ public class StableRandomGenerator imple
                     FastMath.log(FastMath.PI / 2d * omega * cosPhi / betaPhi));
 
                 if (alpha != 1d) {
-                    x = x + beta * FastMath.tan(FastMath.PI * alpha / 2);
+                    x += beta * FastMath.tan(FastMath.PI * alpha / 2);
                 }
             }
         }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/Well19937c.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/Well19937c.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/Well19937c.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/Well19937c.java Sun Nov  3 13:57:37 2013
@@ -105,8 +105,8 @@ public class Well19937c extends Abstract
 
         // add Matsumoto-Kurita tempering
         // to get a maximally-equidistributed generator
-        z4 = z4 ^ ((z4 <<  7) & 0xe46e1700);
-        z4 = z4 ^ ((z4 << 15) & 0x9b868000);
+        z4 ^= (z4 <<  7) & 0xe46e1700;
+        z4 ^= (z4 << 15) & 0x9b868000;
 
         return z4 >>> (32 - bits);
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/Well44497b.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/Well44497b.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/Well44497b.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/random/Well44497b.java Sun Nov  3 13:57:37 2013
@@ -109,8 +109,8 @@ public class Well44497b extends Abstract
 
         // add Matsumoto-Kurita tempering
         // to get a maximally-equidistributed generator
-        z4 = z4 ^ ((z4 <<  7) & 0x93dd1400);
-        z4 = z4 ^ ((z4 << 15) & 0xfa118000);
+        z4 ^= (z4 <<  7) & 0x93dd1400;
+        z4 ^= (z4 << 15) & 0xfa118000;
 
         return z4 >>> (32 - bits);
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Erf.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Erf.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Erf.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Erf.java Sun Nov  3 13:57:37 2013
@@ -150,7 +150,7 @@ public class Erf {
         double p;
 
         if (w < 6.25) {
-            w = w - 3.125;
+            w -= 3.125;
             p =  -3.6444120640178196996e-21;
             p =   -1.685059138182016589e-19 + p * w;
             p =   1.2858480715256400167e-18 + p * w;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/special/Gamma.java Sun Nov  3 13:57:37 2013
@@ -330,11 +330,11 @@ public class Gamma {
                    n < maxIterations &&
                    sum < Double.POSITIVE_INFINITY) {
                 // compute next element in the series
-                n = n + 1.0;
-                an = an * (x / (a + n));
+                n += 1.0;
+                an *= x / (a + n);
 
                 // update partial sum
-                sum = sum + an;
+                sum += an;
             }
             if (n >= maxIterations) {
                 throw new MaxCountExceededException(maxIterations);
@@ -512,7 +512,7 @@ public class Gamma {
     public static double lanczos(final double x) {
         double sum = 0.0;
         for (int i = LANCZOS.length - 1; i > 0; --i) {
-            sum = sum + (LANCZOS[i] / (x + i));
+            sum += LANCZOS[i] / (x + i);
         }
         return sum + LANCZOS[0];
     }
@@ -666,7 +666,7 @@ public class Gamma {
                 double prod = 1.0;
                 double t = x;
                 while (t > 2.5) {
-                    t = t - 1.0;
+                    t -= 1.0;
                     prod *= t;
                 }
                 ret = prod / (1.0 + invGamma1pm1(t - 1.0));
@@ -681,7 +681,7 @@ public class Gamma {
                 double prod = x;
                 double t = x;
                 while (t < -0.5) {
-                    t = t + 1.0;
+                    t += 1.0;
                     prod *= t;
                 }
                 ret = 1.0 / (prod * (1.0 + invGamma1pm1(t)));

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/regression/MillerUpdatingRegression.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/regression/MillerUpdatingRegression.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/regression/MillerUpdatingRegression.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/regression/MillerUpdatingRegression.java Sun Nov  3 13:57:37 2013
@@ -754,7 +754,7 @@ public class MillerUpdatingRegression im
                     for (int _i = m1 + 1; _i < m1 + nvars - m - 1; _i++) {
                         r[_i] /= X;
                     }
-                    rhs[m] = rhs[m] / X;
+                    rhs[m] /= X;
                     bSkipTo40 = true;
                     //break;
                 }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/ArithmeticUtils.java Sun Nov  3 13:57:37 2013
@@ -701,7 +701,7 @@ public final class ArithmeticUtils {
                 result *= k2p;
             }
             k2p *= k2p;
-            e = e >> 1;
+            e >>= 1;
         }
 
         return result;
@@ -775,7 +775,7 @@ public final class ArithmeticUtils {
                 result *= k2p;
             }
             k2p *= k2p;
-            e = e >> 1;
+            e >>= 1;
         }
 
         return result;
@@ -817,7 +817,7 @@ public final class ArithmeticUtils {
                 result = result.multiply(k2p);
             }
             k2p = k2p.multiply(k2p);
-            e = e >> 1;
+            e >>= 1;
         }
 
         return result;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Combinations.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Combinations.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Combinations.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Combinations.java Sun Nov  3 13:57:37 2013
@@ -250,7 +250,7 @@ public class Combinations implements Ite
             }
             // T3
             if (c[1] + 1 < c[2]) {
-                c[1] = c[1] + 1;
+                c[1]++;
                 return ret;
             } else {
                 j = 2;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/FastMath.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/FastMath.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/FastMath.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/FastMath.java Sun Nov  3 13:57:37 2013
@@ -372,7 +372,7 @@ public class FastMath {
             return d; // These are un-normalised - don't try to convert
         }
         long xl = Double.doubleToRawLongBits(d); // can take raw bits because just gonna convert it back
-        xl = xl & MASK_30BITS; // Drop low order bits
+        xl &= MASK_30BITS; // Drop low order bits
         return Double.longBitsToDouble(xl);
     }
 
@@ -1026,8 +1026,8 @@ public class FastMath {
         zb = zb * epsilon + 0.041666663879186654;
         zb = zb * epsilon + 0.16666666666745392;
         zb = zb * epsilon + 0.49999999999999994;
-        zb = zb * epsilon;
-        zb = zb * epsilon;
+        zb *= epsilon;
+        zb *= epsilon;
 
         double za = epsilon;
         double temp = za + zb;
@@ -1302,7 +1302,7 @@ public class FastMath {
             lnza = lnza * epsilon + 0.3333333333332802;
             lnza = lnza * epsilon + -0.5;
             lnza = lnza * epsilon + 1.0;
-            lnza = lnza * epsilon;
+            lnza *= epsilon;
         }
 
         /* Relative sizes:
@@ -1324,27 +1324,27 @@ public class FastMath {
         double c = a+lnm[0];
         double d = -(c-a-lnm[0]);
         a = c;
-        b = b + d;
+        b += d;
 
         c = a + lnza;
         d = -(c - a - lnza);
         a = c;
-        b = b + d;
+        b += d;
 
         c = a + LN_2_B*exp;
         d = -(c - a - LN_2_B*exp);
         a = c;
-        b = b + d;
+        b += d;
 
         c = a + lnm[1];
         d = -(c - a - lnm[1]);
         a = c;
-        b = b + d;
+        b += d;
 
         c = a + lnzb;
         d = -(c - a - lnzb);
         a = c;
-        b = b + d;
+        b += d;
 
         if (hiPrec != null) {
             hiPrec[0] = a;
@@ -1594,7 +1594,7 @@ public class FastMath {
         z = z * lnb + (1.0 / 6.0);
         z = z * lnb + 0.5;
         z = z * lnb + 1.0;
-        z = z * lnb;
+        z *= lnb;
 
         final double result = exp(lna, z, null);
         //result = result + result * z;
@@ -1661,7 +1661,7 @@ public class FastMath {
             d2pLow  = d2pLow * d2p + tmpLow + (tmpHigh - d2pHigh);
             d2p     = d2pHigh + d2pLow;
 
-            e = e >> 1;
+            e >>= 1;
 
         }
 
@@ -1768,13 +1768,13 @@ public class FastMath {
         double c = a + t;
         double d = -(c - a - t);
         a = c;
-        b = b + d;
+        b += d;
 
         t = costA * sinEpsA;
         c = a + t;
         d = -(c - a - t);
         a = c;
-        b = b + d;
+        b += d;
 
         b = b + sintA * cosEpsB + costA * sinEpsB;
         /*
@@ -1824,7 +1824,7 @@ public class FastMath {
             c = a + t;
             d = -(c - a - t);
             a = c;
-            b = b + d;
+            b += d;
         }
 
         result = a + b;
@@ -1912,16 +1912,16 @@ public class FastMath {
         double c = a + t;
         double d = -(c - a - t);
         a = c;
-        b = b + d;
+        b += d;
 
         t = costA*sinEpsA;
         c = a + t;
         d = -(c - a - t);
         a = c;
-        b = b + d;
+        b += d;
 
-        b = b + sintA*cosEpsB + costA*sinEpsB;
-        b = b + sintB + costB*sinEpsA + sintB*cosEpsB + costB*sinEpsB;
+        b += sintA*cosEpsB + costA*sinEpsB;
+        b += sintB + costB*sinEpsA + sintB*cosEpsB + costB*sinEpsB;
 
         double sina = a + b;
         double sinb = -(sina - a - b);
@@ -1934,16 +1934,16 @@ public class FastMath {
         c = a + t;
         d = -(c - a - t);
         a = c;
-        b = b + d;
+        b += d;
 
         t = -sintA*sinEpsA;
         c = a + t;
         d = -(c - a - t);
         a = c;
-        b = b + d;
+        b += d;
 
-        b = b + costB*cosEpsA + costA*cosEpsB + costB*cosEpsB;
-        b = b - (sintB*sinEpsA + sintA*sinEpsB + sintB*sinEpsB);
+        b += costB*cosEpsA + costA*cosEpsB + costB*cosEpsB;
+        b -= sintB*sinEpsA + sintA*sinEpsB + sintB*sinEpsB;
 
         double cosa = a + b;
         double cosb = -(cosa - a - b);
@@ -2066,8 +2066,8 @@ public class FastMath {
         bita = (prodB & 0x8000000000000000L) != 0;
         bitb = (bc & 0x80000000L ) != 0;
 
-        prodB = prodB + (bc << 32);
-        prodA = prodA + (bc >>> 32);
+        prodB += bc << 32;
+        prodA += bc >>> 32;
 
         bitsum = (prodB & 0x8000000000000000L) != 0;
 
@@ -2085,7 +2085,7 @@ public class FastMath {
         ad = a * d;
 
         /* Collect terms */
-        ac = ac + ((bc + ad) >>> 32);
+        ac += (bc + ad) >>> 32;
 
         bita = (prodB & 0x8000000000000000L) != 0;
         bitb = (ac & 0x8000000000000000L ) != 0;
@@ -2152,8 +2152,8 @@ public class FastMath {
         bita = (prod2B & 0x8000000000000000L) != 0;
         bitb = (bc & 0x80000000L ) != 0;
 
-        prod2B = prod2B + (bc << 32);
-        prod2A = prod2A + (bc >>> 32);
+        prod2B += bc << 32;
+        prod2A += bc >>> 32;
 
         bitsum = (prod2B & 0x8000000000000000L) != 0;
 
@@ -2171,7 +2171,7 @@ public class FastMath {
         ad = a * d;
 
         /* Collect terms */
-        ac = ac + ((bc + ad) >>> 32);
+        ac += (bc + ad) >>> 32;
 
         bita = (prod2B & 0x8000000000000000L) != 0;
         bitb = (ac & 0x8000000000000000L ) != 0;
@@ -2193,7 +2193,7 @@ public class FastMath {
         ad = a * d;
 
         /* Collect terms */
-        ac = ac + ((bc + ad) >>> 32);
+        ac += (bc + ad) >>> 32;
 
         bita = (prod2B & 0x8000000000000000L) != 0;
         bitb = (ac & 0x8000000000000000L ) != 0;
@@ -2918,7 +2918,7 @@ public class FastMath {
       za = temp2;
 
       zb = za * yb + ya * zb + zb * yb;
-      za = za * ya;
+      za *= ya;
 
       double na = xs - za;
       double nb = -(na - xs + za);
@@ -2956,7 +2956,7 @@ public class FastMath {
 
         double result = xb * factb + xb * facta + xa * factb + xa * facta;
         if (result == 0) {
-            result = result * x; // ensure correct sign if calculation underflows
+            result *= x; // ensure correct sign if calculation underflows
         }
         return result;
     }
@@ -3090,11 +3090,11 @@ public class FastMath {
                 // the input is a normal number and the result is a subnormal number
 
                 // recover the hidden mantissa bit
-                mantissa = mantissa | (1L << 52);
+                mantissa |= 1L << 52;
 
                 // scales down complete mantissa, hence losing least significant bits
                 final long mostSignificantLostBit = mantissa & (1L << (-scaledExponent));
-                mantissa = mantissa >>> (1 - scaledExponent);
+                mantissa >>>= 1 - scaledExponent;
                 if (mostSignificantLostBit != 0) {
                     // we need to add 1 bit to round up the result
                     mantissa++;
@@ -3111,11 +3111,11 @@ public class FastMath {
 
                 // the input number is subnormal, normalize it
                 while ((mantissa >>> 52) != 1) {
-                    mantissa = mantissa << 1;
+                    mantissa <<= 1;
                     --scaledExponent;
                 }
                 ++scaledExponent;
-                mantissa = mantissa & 0x000fffffffffffffL;
+                mantissa &= 0x000fffffffffffffL;
 
                 if (scaledExponent < 2047) {
                     return Double.longBitsToDouble(sign | (((long) scaledExponent) << 52) | mantissa);
@@ -3174,11 +3174,11 @@ public class FastMath {
                 // the input is a normal number and the result is a subnormal number
 
                 // recover the hidden mantissa bit
-                mantissa = mantissa | (1 << 23);
+                mantissa |= 1 << 23;
 
                 // scales down complete mantissa, hence losing least significant bits
                 final int mostSignificantLostBit = mantissa & (1 << (-scaledExponent));
-                mantissa = mantissa >>> (1 - scaledExponent);
+                mantissa >>>= 1 - scaledExponent;
                 if (mostSignificantLostBit != 0) {
                     // we need to add 1 bit to round up the result
                     mantissa++;
@@ -3195,11 +3195,11 @@ public class FastMath {
 
                 // the input number is subnormal, normalize it
                 while ((mantissa >>> 23) != 1) {
-                    mantissa = mantissa << 1;
+                    mantissa <<= 1;
                     --scaledExponent;
                 }
                 ++scaledExponent;
-                mantissa = mantissa & 0x007fffff;
+                mantissa &= 0x007fffff;
 
                 if (scaledExponent < 255) {
                     return Float.intBitsToFloat(sign | (scaledExponent << 23) | mantissa);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/FastMathCalc.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/FastMathCalc.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/FastMathCalc.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/FastMathCalc.java Sun Nov  3 13:57:37 2013
@@ -424,7 +424,7 @@ class FastMathCalc {
             double err = 1.0 - result[0] * in[0] - result[0] * in[1] -
             result[1] * in[0] - result[1] * in[1];
             /*err = 1.0 - err; */
-            err = err * (result[0] + result[1]);
+            err *= result[0] + result[1];
             /*printf("err = %16e\n", err); */
             result[1] += err;
         }
@@ -453,10 +453,10 @@ class FastMathCalc {
         splitMult(xs, ys, zs);
 
         double tmp = result[0] + zs[0];
-        result[1] = result[1] - (tmp - result[0] - zs[0]);
+        result[1] -= tmp - result[0] - zs[0];
         result[0] = tmp;
         tmp = result[0] + zs[1];
-        result[1] = result[1] - (tmp - result[0] - zs[1]);
+        result[1] -= tmp - result[0] - zs[1];
         result[0] = tmp;
 
         /* a[1] * b[0] */
@@ -465,10 +465,10 @@ class FastMathCalc {
         splitMult(xs, ys, zs);
 
         tmp = result[0] + zs[0];
-        result[1] = result[1] - (tmp - result[0] - zs[0]);
+        result[1] -= tmp - result[0] - zs[0];
         result[0] = tmp;
         tmp = result[0] + zs[1];
-        result[1] = result[1] - (tmp - result[0] - zs[1]);
+        result[1] -= tmp - result[0] - zs[1];
         result[0] = tmp;
 
         /* a[1] * b[0] */
@@ -477,10 +477,10 @@ class FastMathCalc {
         splitMult(xs, ys, zs);
 
         tmp = result[0] + zs[0];
-        result[1] = result[1] - (tmp - result[0] - zs[0]);
+        result[1] -= tmp - result[0] - zs[0];
         result[0] = tmp;
         tmp = result[0] + zs[1];
-        result[1] = result[1] - (tmp - result[0] - zs[1]);
+        result[1] -= tmp - result[0] - zs[1];
         result[0] = tmp;
     }
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.java Sun Nov  3 13:57:37 2013
@@ -86,14 +86,14 @@ public class KMeansPlusPlusClustererTest
                 int points[] = { position1, position2, position3, position4 };
                 // multiply the values
                 for (int j = 0; j < points.length; j++) {
-                    points[j] = points[j] * multiplier;
+                    points[j] *= multiplier;
                 }
                 DoublePoint DoublePoint = new DoublePoint(points);
                 breakingPoints[i] = DoublePoint;
-                position1 = position1 + numberOfVariables;
-                position2 = position2 + numberOfVariables;
-                position3 = position3 + numberOfVariables;
-                position4 = position4 + numberOfVariables;
+                position1 += numberOfVariables;
+                position2 += numberOfVariables;
+                position3 += numberOfVariables;
+                position4 += numberOfVariables;
             }
 
             for (int n = 2; n < 27; ++n) {

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/clustering/KMeansPlusPlusClustererTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/clustering/KMeansPlusPlusClustererTest.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/clustering/KMeansPlusPlusClustererTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/clustering/KMeansPlusPlusClustererTest.java Sun Nov  3 13:57:37 2013
@@ -143,14 +143,14 @@ public class KMeansPlusPlusClustererTest
                 int points[] = { position1, position2, position3, position4 };
                 // multiply the values
                 for (int j = 0; j < points.length; j++) {
-                    points[j] = points[j] * multiplier;
+                    points[j] *= multiplier;
                 }
                 EuclideanIntegerPoint euclideanIntegerPoint = new EuclideanIntegerPoint(points);
                 breakingPoints[i] = euclideanIntegerPoint;
-                position1 = position1 + numberOfVariables;
-                position2 = position2 + numberOfVariables;
-                position3 = position3 + numberOfVariables;
-                position4 = position4 + numberOfVariables;
+                position1 += numberOfVariables;
+                position2 += numberOfVariables;
+                position3 += numberOfVariables;
+                position4 += numberOfVariables;
             }
 
             for (int n = 2; n < 27; ++n) {

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/PrecisionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/PrecisionTest.java?rev=1538368&r1=1538367&r2=1538368&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/PrecisionTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/PrecisionTest.java Sun Nov  3 13:57:37 2013
@@ -297,7 +297,7 @@ public class PrecisionTest {
         Assert.assertEquals(39.25, Precision.round(39.245, 2), 0.0);
         Assert.assertEquals(39.24, Precision.round(39.245, 2, BigDecimal.ROUND_DOWN), 0.0);
         double xx = 39.0;
-        xx = xx + 245d / 1000d;
+        xx += 245d / 1000d;
         Assert.assertEquals(39.25, Precision.round(xx, 2), 0.0);
 
         // BZ 35904



Mime
View raw message