Default implementation for "addToEntry" and "multiplyEntry".


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1188941 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gilles Sadowski 2011-10-25 21:57:15 +00:00
parent d0be1f663e
commit 6ed1d06677
2 changed files with 12 additions and 2 deletions

View File

@ -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() {

View File

@ -52,6 +52,10 @@ The <action> type attribute can be add,update,fix,remove.
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>