lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject svn commit: r1680221 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/util/ lucene/core/src/java/org/apache/lucene/util/packed/ lucene/core/src/test/org/apache/lucene/util/ lucene/core/src/test/org/apa...
Date Tue, 19 May 2015 09:53:39 GMT
Author: jpountz
Date: Tue May 19 09:53:38 2015
New Revision: 1680221

URL: http://svn.apache.org/r1680221
Log:
LUCENE-6484: Removed EliasFanoDocIdSet.

Removed:
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/packed/EliasFanoDecoder.java
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/packed/EliasFanoDocIdSet.java
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/packed/EliasFanoEncoder.java
    lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/util/TestBitUtil.java
    lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/util/packed/TestEliasFanoDocIdSet.java
    lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/util/packed/TestEliasFanoSequence.java
Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/lucene/   (props changed)
    lucene/dev/branches/branch_5x/lucene/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/lucene/core/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/BitUtil.java

Modified: lucene/dev/branches/branch_5x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/CHANGES.txt?rev=1680221&r1=1680220&r2=1680221&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/lucene/CHANGES.txt Tue May 19 09:53:38 2015
@@ -167,6 +167,9 @@ API Changes
   SpanPayloadNearCheckQuery have moved from the .spans package to the .payloads
   package. (Alan Woodward, David Smiley, Paul Elschot)
 
+* LUCENE-6484: Removed EliasFanoDocIdSet, which was unused.
+  (Paul Elschot via Adrien Grand)
+
 Other
 
 * LUCENE-6413: Test runner should report the number of suites completed/ 

Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/BitUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/BitUtil.java?rev=1680221&r1=1680220&r2=1680221&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/BitUtil.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/BitUtil.java
Tue May 19 09:53:38 2015
@@ -218,64 +218,4 @@ public final class BitUtil {
      return ((l >>> 1) ^ -(l & 1));
    }
 
-
-  /** Select a 1-bit from a long. See also LUCENE-6040.
-   * @return The index of the r-th 1 bit in x. This bit must exist.
-   */
-  public static int select(long x, int r) {
-    long s = x - ((x & 0xAAAAAAAAAAAAAAAAL) >>> 1); // pairwise bitsums
-    s = (s & 0x3333333333333333L) + ((s >>> 2) & 0x3333333333333333L); //
nibblewise bitsums
-    s = ((s + (s >>> 4)) & 0x0F0F0F0F0F0F0F0FL) * L8_L; // bytewise bitsums,
cumulative
-
-    int b = (Long.numberOfTrailingZeros((s + psOverflow[r-1]) & (L8_L << 7)) >>
3) << 3; // bit position of byte with r-th 1 bit.
-    long l = r - (((s << 8) >>> b) & 0xFFL); // bit rank in byte at b
-
-    // Select bit l from byte (x >>> b):
-    int selectIndex = (int) (((x >>> b) & 0xFFL) | ((l-1) << 8));
-    int res = b + select256[selectIndex];
-    return res;
-  }
-
-  private final static long L8_L = 0x0101010101010101L;
-
-  private static final long[] psOverflow = new long[64];
-  static {
-    for (int s = 1; s <= 64; s++) {
-      psOverflow[s-1] = (128-s) * L8_L;
-    }
-  }
-
-  private static final byte[] select256 = new byte[8 * 256];
-  static {
-    for (int b = 0; b <= 0xFF; b++) {
-      for (int s = 1; s <= 8; s++) {
-        int byteIndex = b | ((s-1) << 8);
-        int bitIndex = selectNaive(b, s);
-        if (bitIndex < 0) {
-          bitIndex = 127; // positive as byte
-        }
-        assert bitIndex >= 0;
-        assert ((byte) bitIndex) >= 0; // non negative as byte, no need to mask the sign
-        select256[byteIndex] = (byte) bitIndex;
-      }
-    }
-  }
-
-  /**
-   * Naive implementation of {@link #select(long,int)}, using {@link Long#numberOfTrailingZeros}
repetitively.
-   * Works relatively fast for low ranks.
-   * @return The index of the r-th 1 bit in x, or -1 if no such bit exists.
-   */
-  public static int selectNaive(long x, int r) {
-    assert r >= 1;
-    int s = -1;
-    while ((x != 0L) && (r > 0)) {
-      int ntz = Long.numberOfTrailingZeros(x);
-      x >>>= (ntz + 1);
-      s += (ntz + 1);
-      r -= 1;
-    }
-    int res = (r > 0) ? -1 : s;
-    return res;
-  }
 }



Mime
View raw message