You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Oleg Nitz (JIRA)" <ji...@apache.org> on 2014/12/05 10:18:12 UTC
[jira] [Issue Comment Deleted] (MAHOUT-1630) Incorrect
SparseColumnMatrix.numSlices() causes IndexException in toString()
[ https://issues.apache.org/jira/browse/MAHOUT-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oleg Nitz updated MAHOUT-1630:
------------------------------
Comment: was deleted
(was: Well, now I see that the SparseColumnMatrix.numSlices() for some reason mimics DistributedRowMatrix.numSlices(),
but then SparseColumnMatrix should also override iterateAll() and probably 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: 1.0, 0.9
> Reporter: Oleg Nitz
>
> 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)