Class HuffmanParamsCalculator<T>
java.lang.Object
htsjdk.samtools.cram.encoding.core.huffmanUtils.HuffmanParamsCalculator<T>
- Type Parameters:
T
- type of the symbols in the alphabet being huffman-encoded
A utility class that calculates Huffman encoding parameters based on the frequencies of the symbols to be
encoded. Note this does not generate the actual (canonical) huffman codes, it only generates non-canonical
codes as intermediate step in order to determine the huffman bit code lengths, which are part of the encoding
params.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSymbolObservations
(T symbol, int numberOfObservations) Record one or more observations of a given symbol in the input stream.
-
Constructor Details
-
HuffmanParamsCalculator
public HuffmanParamsCalculator()
-
-
Method Details
-
addSymbolObservations
Record one or more observations of a given symbol in the input stream.- Parameters:
symbol
- symbol observednumberOfObservations
- number of observations
-
getHuffmanParams
- Returns:
- the HuffmanParams for the given alphabet
-