AbstractMatrix uses clone() where it should use like()
------------------------------------------------------
Key: MAHOUT-599
URL: https://issues.apache.org/jira/browse/MAHOUT-599
Project: Mahout
Issue Type: Improvement
Components: Math
Reporter: Lance Norskog
Priority: Minor
Fix For: 0.5
The AbstractMatrix.java class uses clone() instead of like() in the methods
which create a new matrix and populate it with calculated data. This means that
the contents of 'this' is copied into the return matrix, then promptly
overwritten.
This patch fixes this problem by substituting like() and changing the code to
not rely on having the values of 'this' in the clone.
Also, this allows generated matrices like a random matrix to reuse the code
from AbstractMatrix; read-only matrices cannot populate their clones.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.