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

Steve Rowe commented on LUCENE-7974:
------------------------------------

bq. I'm wondering whether the use of getMinDelta could be replaced with 
Math.nextUp/Math.nextDown?

These do different things, and I'm not sure how to express one in terms of the 
other.  Suggestions welcome :).

{{getMinDelta}} calculates a fudge factor from the distance exponent reduced by 
(at most) 23, the number of bits in a float mantissa.  This is necessary when 
the result of subtracting/adding the distance in a single dimension has an 
exponent that differs significantly from the distance value.  Without this 
fudge factor (i.e. only subtracting/adding the distance), cells and values can 
be inappropriately judged as outside the search radius.

By contrast, {{Math.nextUp}}/{{Math.nextDown}} produce adjacent values (i.e. 
the equivalent of incrementing/decrementing the mantissa value by one). 

> Add N-dimensional FloatPoint K-nearest-neighbor implementation
> --------------------------------------------------------------
>
>                 Key: LUCENE-7974
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7974
>             Project: Lucene - Core
>          Issue Type: New Feature
>          Components: modules/sandbox
>            Reporter: Steve Rowe
>            Assignee: Steve Rowe
>            Priority: Minor
>         Attachments: LUCENE-7974.patch
>
>
> From LUCENE-7069:
> {quote}
> KD trees (used by Lucene's new dimensional points) excel at finding "nearest 
> neighbors" to a given query point ... I think we should add this to Lucene's 
> sandbox
> [...]
> It could also be generalized to more than 2 dimensions, but for now I'm 
> making the class package private in sandbox for just the geo2d (lat/lon) use 
> case.
> {quote}
> This issue is to generalize {{LatLonPoint.nearest()}} to more than 2 
> dimensions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to