Tabnine Logo
HuffmanCodec.coder
Code IndexAdd Tabnine to your IDE (free)

How to use
coder
method
in
it.unimi.dsi.compression.HuffmanCodec

Best Java code snippets using it.unimi.dsi.compression.HuffmanCodec.coder (Showing top 6 results out of 315)

origin: blazegraph/database

/**
 * This verifies that a code book constructed from a given set of
 * frequencies may be reconstructed from the cord word bit lengths, given in
 * a non-decreasing order, together with the symbols in a correlated array.
 * 
 * @param frequency
 */
public void doRoundTripTest(final int[] frequency) {
  
  final DecoderInputs decoderInputs = new DecoderInputs();
  
  final HuffmanCodec codec = new HuffmanCodec(frequency, decoderInputs);
  if (log.isDebugEnabled()) {
    log.debug(printCodeBook(codec.codeWords()) + "\nlength[]="
        + Arrays.toString(decoderInputs.getLengths()) + "\nsymbol[]="
        + Arrays.toString(decoderInputs.getSymbols()));
  }
  
  final CanonicalFast64CodeWordDecoder actualDecoder = new CanonicalFast64CodeWordDecoder(
      decoderInputs.getLengths(), decoderInputs.getSymbols());
  for (int i = 0; i < frequency.length; i++) {
    final BooleanIterator coded = codec.coder().encode(i/*symbol*/);
    
    assertEquals(i, actualDecoder.decode(coded));
    
  }
}
origin: com.blazegraph/bigdata-core-test

/**
 * This verifies that a code book constructed from a given set of
 * frequencies may be reconstructed from the cord word bit lengths, given in
 * a non-decreasing order, together with the symbols in a correlated array.
 * 
 * @param frequency
 */
public void doRoundTripTest(final int[] frequency) {
  
  final DecoderInputs decoderInputs = new DecoderInputs();
  
  final HuffmanCodec codec = new HuffmanCodec(frequency, decoderInputs);
  if (log.isDebugEnabled()) {
    log.debug(printCodeBook(codec.codeWords()) + "\nlength[]="
        + Arrays.toString(decoderInputs.getLengths()) + "\nsymbol[]="
        + Arrays.toString(decoderInputs.getSymbols()));
  }
  
  final CanonicalFast64CodeWordDecoder actualDecoder = new CanonicalFast64CodeWordDecoder(
      decoderInputs.getLengths(), decoderInputs.getSymbols());
  for (int i = 0; i < frequency.length; i++) {
    final BooleanIterator coded = codec.coder().encode(i/*symbol*/);
    
    assertEquals(i, actualDecoder.decode(coded));
    
  }
}
origin: blazegraph/database

    : new long[size + 1]);
final long sumCodedValueBitLengths2 = writeCodedValues(setup
    .codec().coder(), raba, (Byte2Symbol) setup,
    codedValueOffset, obs);
assert sumCodedValueBitLengths == sumCodedValueBitLengths2 : "sumCodedValueBitLengths="
origin: com.blazegraph/bigdata-core

    : new long[size + 1]);
final long sumCodedValueBitLengths2 = writeCodedValues(setup
    .codec().coder(), raba, (Byte2Symbol) setup,
    codedValueOffset, obs);
assert sumCodedValueBitLengths == sumCodedValueBitLengths2 : "sumCodedValueBitLengths="
origin: blazegraph/database

final PrefixCoder expected = codec.coder();
origin: com.blazegraph/bigdata-core-test

final PrefixCoder expected = codec.coder();
it.unimi.dsi.compressionHuffmanCodeccoder

Javadoc

A cached singleton instance of the coder of this codec.

Popular methods of HuffmanCodec

  • <init>
    Creates a new Huffman codec using the given vector of frequencies.
  • codeWords
  • newCoder
    (Re-)constructs the canonical huffman code from the shortest code word, the non-decreasing bit lengt
  • decoder
  • intArray2LongArray

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • requestLocationUpdates (LocationManager)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Path (java.nio.file)
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now