commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1188941 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/linear/AbstractRealMatrix.java site/xdoc/changes.xml
Date Tue, 25 Oct 2011 21:57:15 GMT
Author: erans
Date: Tue Oct 25 21:57:15 2011
New Revision: 1188941

URL: http://svn.apache.org/viewvc?rev=1188941&view=rev
Log:
MATH-696
Default implementation for "addToEntry" and "multiplyEntry".

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java
    commons/proper/math/trunk/src/site/xdoc/changes.xml

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java?rev=1188941&r1=1188940&r2=1188941&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java
Tue Oct 25 21:57:15 2011
@@ -564,10 +564,16 @@ public abstract class AbstractRealMatrix
     public abstract void setEntry(int row, int column, double value);
 
     /** {@inheritDoc} */
-    public abstract void addToEntry(int row, int column, double increment);
+    public void addToEntry(int row, int column, double increment) {
+        MatrixUtils.checkMatrixIndex(this, row, column);
+        setEntry(row, column, getEntry(row, column) + increment);
+    }
 
     /** {@inheritDoc} */
-    public abstract void multiplyEntry(int row, int column, double factor);
+    public void multiplyEntry(int row, int column, double factor) {
+        MatrixUtils.checkMatrixIndex(this, row, column);
+        setEntry(row, column, getEntry(row, column) * factor);
+    }
 
     /** {@inheritDoc} */
     public RealMatrix transpose() {

Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/changes.xml?rev=1188941&r1=1188940&r2=1188941&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/changes.xml Tue Oct 25 21:57:15 2011
@@ -52,6 +52,10 @@ The <action> type attribute can be add,u
     If the output is not quite correct, check for invisible trailing spaces!
      -->
     <release version="3.0" date="TBD" description="TBD">
+      <action dev="erans" type="update" issue="MATH-696">
+        Default implementation for "addToEntry" and "multiplyEntry" in
+        "AbstractRealMatrix".
+      </action>
       <action dev="erans" type="add" issue="MATH-685">
         Method "addToEntry" in "RealVector".
       </action>



Mime
View raw message