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

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

GitHub user smarthi opened a pull request:

    https://github.com/apache/mahout/pull/115

    MAHOUT-1630:Incorrect SparseColumnMatrix.numSlices() causes IndexExcepti...

    ...on in toString()

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/smarthi/mahout MAHOUT-1630

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/mahout/pull/115.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #115
    
----
commit aa50e15433ae56cebd58962d6e0c262bbdd2b06e
Author: Suneel Marthi <[email protected]>
Date:   2015-04-08T04:39:54Z

    MAHOUT-1630:Incorrect SparseColumnMatrix.numSlices() causes IndexException 
in toString()

----


> Incorrect SparseColumnMatrix.numSlices() causes IndexException in toString()
> ----------------------------------------------------------------------------
>
>                 Key: MAHOUT-1630
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1630
>             Project: Mahout
>          Issue Type: Bug
>          Components: Math
>    Affects Versions: 0.9
>            Reporter: Oleg Nitz
>            Assignee: Suneel Marthi
>              Labels: legacy, math, scala
>             Fix For: 0.10.0
>
>
> SparseColumnMatrix overrides the numSlices() method incorrectly: it returns 
> numCols() instead of numRows(). 
> As a result, AbstractMaxtrix.toString() for wide matrices throws an exception.
> For example, this code:
> {quote}
>     Matrix matrix = new SparseColumnMatrix(1, 2);
>     matrix.toString();
> {quote}
> causes
> {quote}
> org.apache.mahout.math.IndexException: Index 1 is outside allowable range of 
> [0,1)
>         at 
> org.apache.mahout.math.MatrixVectorView.<init>(MatrixVectorView.java:42)
>         at 
> org.apache.mahout.math.AbstractMatrix.viewRow(AbstractMatrix.java:290)
>         at 
> org.apache.mahout.math.AbstractMatrix$1.computeNext(AbstractMatrix.java:68)
>         at 
> org.apache.mahout.math.AbstractMatrix$1.computeNext(AbstractMatrix.java:59)
>         at 
> com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
>         at 
> com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
>         at 
> org.apache.mahout.math.AbstractMatrix.toString(AbstractMatrix.java:787)
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to