|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.unimi.dsi.sux4j.mph.Hashes
public class Hashes
Basic hash functions.
| Method Summary | |
|---|---|
static long |
jenkins(BitVector bv)
Jenkins 64-bit hashing. |
static long |
jenkins(BitVector bv,
long seed)
Jenkins 64-bit hashing. |
static void |
jenkins(BitVector bv,
long seed,
long[] h)
Jenkins 64-bit hashing (all three values produced). |
static long |
jenkins(BitVector bv,
long prefixLength,
long[] aa,
long[] bb,
long[] cc)
Constant-time Jenkins 64-bit hashing for any prefix. |
static void |
jenkins(BitVector bv,
long prefixLength,
long[] aa,
long[] bb,
long[] cc,
long[] h)
Constant-time Jenkins 64-bit hashing for any prefix (all three values produced). |
static void |
jenkins(long[] triple,
long seed,
long[] h)
Jenkins 64-bit hashing (all three values produced) for a triple of longs. |
static long[][] |
preprocessJenkins(BitVector bv,
long seed)
Preprocesses a bit vector so that Jenkins 64-bit hashing can be computed in constant time on all prefixes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void jenkins(BitVector bv,
long seed,
long[] h)
This code is based on the lookup8.c, and in particular on the version consuming 64 bits at a time, but it has been slightly modified to work correctly with any bit vector length (not just multiples of 64). Moreover, we return all three values generated by the algorithm.
bv - a bit vector.seed - a seed for the hash.h - a triple of long values in which the three generated hashes will be saved.
public static long jenkins(BitVector bv,
long seed)
bv - a bit vector.seed - a seed for the hash.
jenkins(BitVector, long, long[]).public static long jenkins(BitVector bv)
bv - a bit vector.
jenkins(BitVector, long, long[]) with seed 0.
public static long[][] preprocessJenkins(BitVector bv,
long seed)
bv - a bit vector.seed - a seed for the hash.
a, b and c
during the hash computation; these vector must be passed to jenkins(BitVector, long, long[], long[], long[]) (and analogous functions) in this order.jenkins(BitVector)
public static void jenkins(BitVector bv,
long prefixLength,
long[] aa,
long[] bb,
long[] cc,
long[] h)
bv - a bit vector.prefixLength - the length of the prefix of bv over which the hash must be computed.aa - the first state array returned by preprocessJenkins(BitVector, long).bb - the second state array returned by preprocessJenkins(BitVector, long).cc - the third state array returned by preprocessJenkins(BitVector, long).h - a triple of long values in which the three generated hashes will be saved.
public static long jenkins(BitVector bv,
long prefixLength,
long[] aa,
long[] bb,
long[] cc)
bv - a bit vector.prefixLength - the length of the prefix of bv over which the hash must be computed.aa - the first state array returned by preprocessJenkins(BitVector, long).bb - the second state array returned by preprocessJenkins(BitVector, long).cc - the third state array returned by preprocessJenkins(BitVector, long).
jenkins(BitVector, long, long[], long[], long[], long[]).
public static void jenkins(long[] triple,
long seed,
long[] h)
triple - three longs.seed - a seed for the hash.h - a triple of long values in which the three generated hashes will be saved.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||