[ 
https://issues.apache.org/jira/browse/MAHOUT-531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924425#action_12924425
 ] 

Ted Dunning commented on MAHOUT-531:
------------------------------------

{quote}
 Currently the iterateNonZero() of DenseVector skips elements whose value is 
zero. 
{quote}
You have an interesting point.

So... if we back up to a step closer to first principles, I think that the key 
here is that iterateNonZero is allowed to skip zeros, but cannot be required to 
(since some sparse representations don't necessary know exactly without a 
test).  The goal is to have the iteration proceed more quickly, if it can.  The 
importance here is that for very sparse matrices/vectors we shouldn't be 
required to iterate through all possible elements even if they don't exist.

What this means for dense vectors is kind of an open question and probably is a 
matter for experimentation.  Presumably, anybody who is calling iterateNonZero 
would just as soon not be bothered with extra elements and it is clearly not a 
problem to eliminate zeros from the iterations from an algorithmic point of 
view.  Whether it slows things down or not is quite an open question in my mind.

My final vote, I guess is +0 for filtering out the zeros with iterateNonZero 
and dense matrices.

Does anybody else have an opinion?  Jake?  Drew?  Shannon?  Robin?


> MatrixWritable doesn't actually write/read anything
> ---------------------------------------------------
>
>                 Key: MAHOUT-531
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-531
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>            Reporter: Alexander Hans
>         Attachments: MAHOUT-531.patch, MAHOUT-531.patch
>
>
> The write() and readFields() methods of MatrixWritable write/read only the 
> classname, they don't write/read actual data.

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

Reply via email to