Package it.unimi.dsi.sux4j.mph.codec
Interface Codec
-
- All Known Implementing Classes:
Codec.Binary,Codec.Gamma,Codec.Huffman,Codec.Unary,Codec.ZeroCodec
public interface CodecA class representing a specific instantaneous code for compressed functions. The logic of this code is quite tightly coupled with such functions, and it is unlikely to be resusable elsewhere easily.- Author:
- Sebastiano Vigna, Marco Genuzio
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCodec.BinaryA binary fixed-width codec.static interfaceCodec.CoderA coder: provides methods to turn symbols into codewords.static interfaceCodec.DecoderA decoder: provides a method to turn sequences of bits into symbols.static classCodec.GammaA codec based on Elias's γ code (starting at zero).static classCodec.HuffmanA Huffman codec with length-limiting capabilities and a fast canonical decoder.static classCodec.UnaryA unary codec (starting at zero).static classCodec.ZeroCodecA degenerate stateless codec (always returns zero).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Codec.CodergetCoder(it.unimi.dsi.fastutil.longs.Long2LongMap frequencies)Returns a coder for a specific map from symbols to frequencies.
-
-
-
Method Detail
-
getCoder
Codec.Coder getCoder(it.unimi.dsi.fastutil.longs.Long2LongMap frequencies)
Returns 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.- Parameters:
frequencies- a map from symbols (longs) to frequencies (longs).- Returns:
- a coder for the given map.
-
-