Class Codec.Huffman
java.lang.Object
it.unimi.dsi.sux4j.mph.codec.Codec.Huffman
- All Implemented Interfaces:
Codec
- Enclosing interface:
Codec
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface Codec
Codec.Binary, Codec.Decoder, Codec.Gamma, Codec.Huffman, Codec.Unary, Codec.ZeroCodec -
Constructor Summary
ConstructorsConstructorDescriptionHuffman()Creates a new Huffman codec no length limitations.Huffman(int maxDecodingTableLength) Creates a new Huffman codec with specified limit and entropy threshold equal to 0.999.Huffman(int maxDecodingTableLength, double entropyThreshold) Creates a new Huffman codec with specified limit and entropy threshold. -
Method Summary
Modifier and TypeMethodDescriptiongetCoder(it.unimi.dsi.fastutil.longs.Long2LongMap frequencies) Returns a coder for a specific map from symbols to frequencies.
-
Constructor Details
-
Huffman
public Huffman(int maxDecodingTableLength, double entropyThreshold) Creates a new Huffman codec with specified limit and entropy threshold.- Parameters:
maxDecodingTableLength- a hard limit for the length of the decoding table.entropyThreshold- the decoding table will be truncated if the accumulated entropy (starting from the most frequent symbols) exceeds this fraction of the overall entropy.
-
Huffman
public Huffman(int maxDecodingTableLength) Creates a new Huffman codec with specified limit and entropy threshold equal to 0.999.- Parameters:
maxDecodingTableLength- a hard limit for the length of the decoding table.
-
Huffman
public Huffman()Creates a new Huffman codec no length limitations.
-
-
Method Details
-
getCoder
Description copied from interface:CodecReturns a coder for a specific map from symbols to frequencies.Note that even instantaneous codes (such as
Codec.Unary) need to know the set of symbols, as the returned coder needs to known the maximum codeword length.
-