Searched refs:lookup3ycs (Results 1 - 2 of 2) sorted by relevance

/lucene-3.6.0/solr/solrj/src/test/org/apache/solr/common/util/
H A DTestHash.java24 /** Tests for lookup3ycs hash functions
52 int hash2 = Hash.lookup3ycs(a, 0, len, i*12345+(len<<2));
54 int hash3 = Hash.lookup3ycs(s, 0, len, i*12345+(len<<2));
66 int hash2 = Hash.lookup3ycs(utf32, 0, len, seed);
68 int hash3 = Hash.lookup3ycs(sb, 0, sb.length(), seed);
/lucene-3.6.0/solr/solrj/src/java/org/apache/solr/common/util/
H A DHash.java29 * <p>The only problem with using lookup3 hashword is that it includes a length in the initial value. This would suck some performance out since directly hashing a UTF8 or UTF16 string (Java) would require a pre-scan to get the actual number of unicode code points. The solution was to simply remove the length factor, which is equivalent to biasing initVal by -(numCodePoints*4). This slightly modified lookup3 I define as lookup3ycs.
31 * <p>So the definition of the cross-platform string hash lookup3ycs is as follows:
38 * lookup3ycs(k,offset,length,initval) == lookup3(k,offset,length,initval-(length*4))
42 * lookup3ycs(k,offset,length,initval+(length*4)) == lookup3(k,offset,length,initval)
44 * <p>An obvious advantage of this relationship is that you can use lookup3 if you don't have an implementation of lookup3ycs.
113 * {@code lookup3ycs(k,offset,length,initval) == lookup3(k,offset,length,initval-(length<<2))}
115 * {@code lookup3ycs(k,offset,length,initval+(length<<2)) == lookup3(k,offset,length,initval)}
117 public static int lookup3ycs(int[] k, int offset, int length, int initval) { method in class:Hash
124 * it's unicode code points, according to {@link #lookup3ycs(int[] k, int offset, int length, int initval)}
128 * via {@code lookup3ycs(
130 public static int lookup3ycs(CharSequence s, int start, int end, int initval) { method in class:Hash
[all...]

Completed in 11 milliseconds