|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<K>
it.unimi.dsi.sux4j.mph.AbstractHashFunction<T>
it.unimi.dsi.sux4j.mph.TwoStepsLcpMonotoneMinimalPerfectHashFunction<T>
public class TwoStepsLcpMonotoneMinimalPerfectHashFunction<T>
A monotone minimal perfect hash implementation based on fixed-size bucketing that uses
longest common prefixes as distributors, and store their lengths using a 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.
Field Summary | |
---|---|
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
|
protected int |
log2BucketSize
Fast.ceilLog2(int) of bucketSize . |
protected int |
n
The number of elements. |
protected MWHCFunction<BitVector> |
offsets
A function mapping each element to the offset inside its bucket (lowest log2BucketSize bits) and
to the length of the longest common prefix of its bucket (remaining bits). |
static long |
serialVersionUID
|
protected TransformationStrategy<? super T> |
transform
The transformation strategy. |
Fields inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction |
---|
defRetValue |
Constructor Summary | |
---|---|
TwoStepsLcpMonotoneMinimalPerfectHashFunction(Iterable<? extends T> iterable,
TransformationStrategy<? super T> transform)
|
Method Summary | |
---|---|
long |
getLong(Object o)
|
boolean |
hasTerms()
|
static void |
main(String[] arg)
|
long |
numBits()
Returns the number of bits used by this structure. |
int |
size()
Returns the number of terms hashed. |
Methods inherited from class it.unimi.dsi.sux4j.mph.AbstractHashFunction |
---|
containsKey |
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction |
---|
clear, defaultReturnValue, defaultReturnValue, get, put, put, remove, removeLong |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
protected final int n
protected final int bucketSize
protected final int log2BucketSize
Fast.ceilLog2(int)
of bucketSize
.
protected final int bucketSizeMask
log2BucketSize
bits.
protected final MWHCFunction<BitVector> offsets
log2BucketSize
bits) and
to the length of the longest common prefix of its bucket (remaining bits).
protected final TwoStepsMWHCFunction<BitVector> lcpLengths
protected final MWHCFunction<BitVector> lcp2Bucket
protected final TransformationStrategy<? super T> transform
Constructor Detail |
---|
public TwoStepsLcpMonotoneMinimalPerfectHashFunction(Iterable<? extends T> iterable, TransformationStrategy<? super T> transform)
Method Detail |
---|
public long getLong(Object o)
getLong
in interface Object2LongFunction<T>
public int size()
size
in interface Function<T,Long>
size
in class AbstractHashFunction<T>
public long numBits()
public boolean hasTerms()
public static void main(String[] arg) throws NoSuchMethodException, IOException, JSAPException
NoSuchMethodException
IOException
JSAPException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |