[ 
https://issues.apache.org/jira/browse/SPARK-14187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chenliang Xu updated SPARK-14187:
---------------------------------
    Description: 
{{SparseMatrix}} use binarySearch to find {{index}}. 

{quote}
binarySearch returns index of the search key, if it is contained in the array 
within the specified range; otherwise, (-(insertion point) - 1).
{quote}

On the other hand, {{update}} method only compare the returned index with -1 to 
decide whether it is found or not.

  was:
{{SparseMatrix}} use binarySearch to find {{index}}. 

{quote}
binarySearch returns index of the search key, if it is contained in the array 
within the specified range; otherwise, (-(insertion point) - 1).
{quote}

On the other hand, {{update}} method only compare the returned index with 
{{-1}} to decide whether it is found or not.


> Incorrect use of binarysearch in SparseMatrix
> ---------------------------------------------
>
>                 Key: SPARK-14187
>                 URL: https://issues.apache.org/jira/browse/SPARK-14187
>             Project: Spark
>          Issue Type: Bug
>          Components: MLlib
>    Affects Versions: 1.6.1
>            Reporter: Chenliang Xu
>            Priority: Minor
>
> {{SparseMatrix}} use binarySearch to find {{index}}. 
> {quote}
> binarySearch returns index of the search key, if it is contained in the array 
> within the specified range; otherwise, (-(insertion point) - 1).
> {quote}
> On the other hand, {{update}} method only compare the returned index with -1 
> to decide whether it is found or not.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to