public class VLLcpMonotoneMinimalPerfectHashFunction<T> extends AbstractHashFunction<T> implements Serializable, Size64
MinimalPerfectHashFunction
indexing an EliasFanoLongBigList. In theory, this function should use less memory
than an LcpMonotoneMinimalPerfectHashFunction when the lengths of common prefixes vary
wildly, but in practice a TwoStepsLcpMonotoneMinimalPerfectHashFunction is often a better choice.| 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 EliasFanoLongBigList |
lcpLengths
A list, indexed by
mph, containing for each element the length of the longest common prefix of its bucket. |
protected int |
log2BucketSize
|
protected MinimalPerfectHashFunction<BitVector> |
mph
A function mapping each element to a distinct index.
|
protected long |
n
The number of elements.
|
protected LongBigList |
offsets
A list, indexed by
mph, containing the offset of each element inside its bucket. |
static long |
serialVersionUID |
protected TransformationStrategy<? super T> |
transform
The transformation strategy.
|
defRetValue| Constructor and Description |
|---|
VLLcpMonotoneMinimalPerfectHashFunction(Iterable<? extends T> iterable,
int numElements,
TransformationStrategy<? super T> transform) |
VLLcpMonotoneMinimalPerfectHashFunction(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 MinimalPerfectHashFunction<BitVector> mph
protected final LongBigList offsets
mph, containing the offset of each element inside its bucket.protected final EliasFanoLongBigList lcpLengths
mph, containing for each element the length of the longest common prefix of its bucket.protected final MWHCFunction<BitVector> lcp2Bucket
protected final TransformationStrategy<? super T> transform
public VLLcpMonotoneMinimalPerfectHashFunction(Iterable<? extends T> iterable, TransformationStrategy<? super T> transform) throws IOException
IOExceptionpublic VLLcpMonotoneMinimalPerfectHashFunction(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