You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Jake Mannix (JIRA)" <ji...@apache.org> on 2010/01/21 14:16:54 UTC

[jira] Resolved: (MAHOUT-211) DenseMatrix.getRow() and getColumn() return deep copies of the data

     [ https://issues.apache.org/jira/browse/MAHOUT-211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Mannix resolved MAHOUT-211.
--------------------------------

    Resolution: Fixed

committed an initial pass of this in r901692

> DenseMatrix.getRow() and getColumn() return deep copies of the data
> -------------------------------------------------------------------
>
>                 Key: MAHOUT-211
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-211
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.1
>         Environment: all
>            Reporter: Jake Mannix
>            Assignee: Jake Mannix
>            Priority: Minor
>             Fix For: 0.3
>
>
> As mentioned in the summary, DenseMatrix.getRow() returns a new DenseVector(values[row]) instead of just a shallow reference.  This is a) wasteful, and b) inconsistent with what SparseRowMatrix / SparseColumnMatrix do, which means that users who think they can mutate rows by calling getRow() are wrong for DenseMatrix, or conversely think they can modify the row at will are wrong for SparseRowMatrix.  
> Either way, we need to be consistent.  I would suggest the contract be that you get a shallow view reference (meaning, it may be an actual reference to a real Vector, or it may be a virtual Vector, dynamically constructed, which is still backed by entries in the matrix), so that calling Matrix.getRow(row).set(col, value) has the same affect as Matrix.set(row, col, value).  If we don't do it this way, we should at least provide an api to get a shallow reference to rows.
> Thoughts?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.