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

ASF GitHub Bot commented on MAHOUT-1595:
----------------------------------------

Github user avati commented on the pull request:

    https://github.com/apache/mahout/pull/25#issuecomment-48974295
  
    If you take a row view of a sparse row matrix, this code is not even used. 
RandomAccessSparseVector.java has its own NonDefaultIterator() which exploits 
sparseness and that gets used in a row view of a sparse matrix. Similarly  
DenseVector has its NonDefaultIterator() which works on a dense vector is used 
in a row view of a DenseMatrix.
    
    However for "custom" matrix (like H2OBlockMatrix in 
https://github.com/avati/mahout/blob/MAHOUT-1500/h2o/src/main/java/org/apache/mahout/h2obindings/H2OBlockMatrix.java)
 which is neither inherited from SparseMatrix nor from DenseMatrix, viewRow() 
returns a MatrixVectorView. In this case no assumption can be made about 
sparseness about the custom matrix, and this default implementation must 
fall-back to a dense-like implementation (which guarantees to give correct 
results no matter the nature of the matrix)


> iterateNonZero() is broken in MatrixVectorView
> ----------------------------------------------
>
>                 Key: MAHOUT-1595
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1595
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>            Reporter: Anand Avati
>
> iterateNonZero() in MatrixVectorView is broken and behaves like a normal 
> iterator, over all elements.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to