commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1536147 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math3/analysis/differentiation/SparseGradient.java test/java/org/apache/commons/math3/analysis/differentiation/SparseGradientTest.java
Date Sun, 27 Oct 2013 14:39:17 GMT
Author: luc
Date: Sun Oct 27 14:39:16 2013
New Revision: 1536147

URL: http://svn.apache.org/r1536147
Log:
Fixed wrong naming and typo.

Thanks to Gilles for spotting this!

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/differentiation/SparseGradient.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/analysis/differentiation/SparseGradientTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/differentiation/SparseGradient.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/differentiation/SparseGradient.java?rev=1536147&r1=1536146&r2=1536147&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/differentiation/SparseGradient.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/analysis/differentiation/SparseGradient.java
Sun Oct 27 14:39:16 2013
@@ -235,7 +235,7 @@ public class SparseGradient implements R
      * </p>
      * @param a instance to multiply
      */
-    public void multInPlace(final SparseGradient a) {
+    public void multiplyInPlace(final SparseGradient a) {
         // Derivatives.
         for (Map.Entry<Integer, Double> entry : derivatives.entrySet()) {
             derivatives.put(entry.getKey(), a.value * entry.getValue());
@@ -872,7 +872,7 @@ public class SparseGradient implements R
      */
     @Override
     public int hashCode() {
-        return 743 + 809 *  + 233 * MathUtils.hash(value) + 167 * derivatives.hashCode();
+        return 743 + 809 * MathUtils.hash(value) + 167 * derivatives.hashCode();
     }
 
 }

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/analysis/differentiation/SparseGradientTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/analysis/differentiation/SparseGradientTest.java?rev=1536147&r1=1536146&r2=1536147&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/analysis/differentiation/SparseGradientTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/analysis/differentiation/SparseGradientTest.java
Sun Oct 27 14:39:16 2013
@@ -126,7 +126,7 @@ public class SparseGradientTest extends 
         final SparseGradient var1 = SparseGradient.createVariable(id1, v1);
         final SparseGradient sum = var1.multiply(c1);
         final SparseGradient mult = SparseGradient.createVariable(id2, v2);
-        mult.multInPlace(var1);
+        mult.multiplyInPlace(var1);
         sum.addInPlace(mult);
         Assert.assertEquals(v1 * c1 + v2 * v1, sum.getValue(), 1.0e-15); // returns the value
         Assert.assertEquals(2, sum.numVars());



Mime
View raw message