[
https://issues.apache.org/jira/browse/MAHOUT-1301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexander Senov updated MAHOUT-1301:
------------------------------------
Labels: patch (was: )
Status: Patch Available (was: Open)
Changes list:
1. AbstractVector.sparseToString() method added - toString() realization for
sparse vectors via iterateNonZero()
2. RandomAccessSparseVector & SequentialAccessSparseVector toString() methods
replaced by calling sparseToString() method
3. Add AbstractVectorTest.testToString() routine for testing toString
realization. toString() method test case added to TestRandomAccessSparseVector,
TestSequentialAccessSparseVector and TestDenseVector.
> toString() method of SequentialAccessSparseVector has excess comma at the end
> -----------------------------------------------------------------------------
>
> Key: MAHOUT-1301
> URL: https://issues.apache.org/jira/browse/MAHOUT-1301
> Project: Mahout
> Issue Type: Bug
> Components: Math
> Affects Versions: 0.8
> Reporter: Alexander Senov
> Priority: Trivial
> Labels: patch
> Attachments: MAHOUT-1301.patch
>
>
> Realization of SequentialAccessSparseVector toString() method had changed in
> MAHOUT-1259 patch. Unfortunately, that patch introduced new bug: output of
> the toString() method had been changed - extra comma added at the end of the
> string
> Example:
> Consider following sparse vector
> {code:java}
> Vector v = new SequentialAccessSparseVector(capacity);
> v.set(1, 0.1);
> v.set(3, 0.3);
> {code}
> In 0.7 v.toString() returns following string:
> {code:java}
> {1:0.1,3:0.3}
> {code}
> but in 0.8 it returns
> {code:java}
> {1:0.1,3:0.3,}
> {code}
> As you can see, there is extra comma at the end of the string.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira