it.unimi.dsi.sux4j.mph
Class HollowTrieMonotoneMinimalPerfectHashFunction<T>

java.lang.Object
  extended by it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction<K>
      extended by it.unimi.dsi.sux4j.mph.AbstractHashFunction<T>
          extended by it.unimi.dsi.sux4j.mph.HollowTrieMonotoneMinimalPerfectHashFunction<T>
All Implemented Interfaces:
Function<T,Long>, Object2LongFunction<T>, Serializable

public class HollowTrieMonotoneMinimalPerfectHashFunction<T>
extends AbstractHashFunction<T>
implements Serializable

A hollow trie, that is, a compacted trie recording just the length of the paths associated to the internal nodes.

Instances of this class can be used to compute a monotone minimal perfect hashing of the keys.

See Also:
Serialized Form

Field Summary
protected  JacobsonBalancedParentheses balParen
          A balanced parentheses structure over trie.
protected  EliasFanoLongBigList skips
           
protected  LongArrayBitVector trie
          The bit vector containing Jacobson's representation of the trie.
 
Fields inherited from class it.unimi.dsi.fastutil.objects.AbstractObject2LongFunction
defRetValue
 
Constructor Summary
HollowTrieMonotoneMinimalPerfectHashFunction(Iterable<? extends T> iterable, TransformationStrategy<? super T> transform)
           
HollowTrieMonotoneMinimalPerfectHashFunction(Iterator<? extends T> iterator, TransformationStrategy<? super T> transform)
           
 
Method Summary
 long getLong(Object object)
           
static void main(String[] arg)
           
 long numBits()
           
 int size()
           
 
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

skips

protected EliasFanoLongBigList skips

trie

protected final LongArrayBitVector trie
The bit vector containing Jacobson's representation of the trie.


balParen

protected JacobsonBalancedParentheses balParen
A balanced parentheses structure over trie.

Constructor Detail

HollowTrieMonotoneMinimalPerfectHashFunction

public HollowTrieMonotoneMinimalPerfectHashFunction(Iterable<? extends T> iterable,
                                                    TransformationStrategy<? super T> transform)

HollowTrieMonotoneMinimalPerfectHashFunction

public HollowTrieMonotoneMinimalPerfectHashFunction(Iterator<? extends T> iterator,
                                                    TransformationStrategy<? super T> transform)
Method Detail

getLong

public long getLong(Object object)
Specified by:
getLong in interface Object2LongFunction<T>

size

public int size()
Specified by:
size in interface Function<T,Long>
Overrides:
size in class AbstractHashFunction<T>

numBits

public long numBits()

main

public static void main(String[] arg)
                 throws NoSuchMethodException,
                        IOException,
                        JSAPException
Throws:
NoSuchMethodException
IOException
JSAPException