Yexi Jiang created HAMA-782:
-------------------------------

             Summary: The arguments of DoubleVector.slice(int, int) method will 
mislead the user
                 Key: HAMA-782
                 URL: https://issues.apache.org/jira/browse/HAMA-782
             Project: Hama
          Issue Type: Improvement
          Components: machine learning, math
            Reporter: Yexi Jiang
            Assignee: Yexi Jiang
             Fix For: 0.6.3


The current implementation of DoubleVector.slice(int, int) is ambiguous.
Current description of this method is as follows:

--------------------------------------------------------
Slices this vector from index offset with the given length. So you end at the 
upper bound of (offset+length).
--------------------------------------------------------

If the given vector is vec = [0, 1, 2, 3, 4, 5, 6], and user uses vec.slice(2, 
3) and hope to get [2, 3, 4]. However, it actually returns [2,3].

This is because the actual implementation extract the elements start from 
'offset' and end at 'length' (exclusive). The argument name will mislead the 
user.


--
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

Reply via email to