You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Amish Shah (Jira)" <ji...@apache.org> on 2019/08/25 15:53:00 UTC

[jira] [Commented] (LUCENE-8758) Class Field levelN is not populated correctly in QuadPrefixTree

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

Amish Shah commented on LUCENE-8758:
------------------------------------

Hi, can I take a shot at this?

> Class Field levelN is not populated correctly in QuadPrefixTree
> ---------------------------------------------------------------
>
>                 Key: LUCENE-8758
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8758
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/spatial-extras
>    Affects Versions: 4.0, 5.0, 6.0, 7.0, 8.0
>            Reporter: Dominic Page
>            Priority: Trivial
>              Labels: beginner
>             Fix For: 8.x
>
>
> QuadPrefixTree in Lucene prepopulates these arrays:
> {{levelW = new double[maxLevels];}}
> {{levelH = new double[maxLevels];}}
> {{*levelS = new int[maxLevels];*}}
> {{*levelN = new int[maxLevels];*}}
> Like this
> {{for (int i = 1; i < levelW.length; i++) {}}
> {{ levelW[i] = levelW[i - 1] / 2.0;}}
> {{ levelH[i] = levelH[i - 1] / 2.0;}}
> {{ *levelS[i] = levelS[i - 1] * 2;*}}
> {{ *levelN[i] = levelN[i - 1] * 4;*}}
> {{}}}
> The field
> {{levelN[]}}
> overflows after level 14 = 1073741824 where maxLevels is limited to 
> {{MAX_LEVELS_POSSIBLE = 50;}}
> The field levelN appears not to be used anywhere. Likewise, the field
> {{levelS[] }}
> is only used in the 
> {{printInfo}}
> method. I would propose either to remove both 
> {{levelN[],}}{{levelS[]}}
> or to change the datatype
> {{levelN = new long[maxLevels];}}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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