public class TwoStepsLcpMonotoneMinimalPerfectHashFunction<T> extends AbstractHashFunction<T> implements Size64, Serializable
TwoStepsMWHCFunction.
This implementation should use a few less bits per elements than LcpMonotoneMinimalPerfectHashFunction,
but it is a bit slower as one or two additional functions must be queried.
| Modifier and Type | Field and Description |
|---|---|
protected int |
bucketSize
The size of a bucket.
|
protected int |
bucketSizeMask
The mask for
log2BucketSize bits. |
protected MWHCFunction<BitVector> |
lcp2Bucket
A function mapping each longest common prefix to its bucket.
|
protected TwoStepsMWHCFunction<BitVector> |
lcpLengths
A function mapping each element to the length of the longest common prefix of its bucket.
|
protected int |
log2BucketSize
|
protected long |
n
The number of elements.
|
protected MWHCFunction<BitVector> |
offsets
A function mapping each element to the offset inside its bucket.
|
static long |
serialVersionUID |
protected TransformationStrategy<? super T> |
transform
The transformation strategy.
|
defRetValue| Constructor and Description |
|---|
TwoStepsLcpMonotoneMinimalPerfectHashFunction(Iterable<? extends T> iterable,
int numElements,
TransformationStrategy<? super T> transform) |
TwoStepsLcpMonotoneMinimalPerfectHashFunction(Iterable<? extends T> iterable,
TransformationStrategy<? super T> transform) |
| Modifier and Type | Method and Description |
|---|---|
long |
getLong(Object o) |
boolean |
hasTerms() |
static void |
main(String[] arg) |
long |
numBits()
Returns the number of bits used by this structure.
|
long |
size64() |
containsKey, sizeclear, defaultReturnValue, defaultReturnValue, get, put, put, remove, removeLongpublic static final long serialVersionUID
protected final long n
protected final int bucketSize
protected final int log2BucketSize
protected final int bucketSizeMask
log2BucketSize bits.protected final MWHCFunction<BitVector> offsets
protected final TwoStepsMWHCFunction<BitVector> lcpLengths
protected final MWHCFunction<BitVector> lcp2Bucket
protected final TransformationStrategy<? super T> transform
public TwoStepsLcpMonotoneMinimalPerfectHashFunction(Iterable<? extends T> iterable, TransformationStrategy<? super T> transform) throws IOException
IOExceptionpublic TwoStepsLcpMonotoneMinimalPerfectHashFunction(Iterable<? extends T> iterable, int numElements, TransformationStrategy<? super T> transform) throws IOException
IOExceptionpublic long getLong(Object o)
getLong in interface Object2LongFunction<T>public long size64()
size64 in interface Size64size64 in class AbstractHashFunction<T>public long numBits()
public boolean hasTerms()
public static void main(String[] arg) throws NoSuchMethodException, IOException, JSAPException