congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HuffmanCodec$DecoderInputs.getSymbols
Code IndexAdd Tabnine to your IDE (free)

How to use
getSymbols
method
in
it.unimi.dsi.compression.HuffmanCodec$DecoderInputs

Best Java code snippets using it.unimi.dsi.compression.HuffmanCodec$DecoderInputs.getSymbols (Showing top 16 results out of 315)

origin: blazegraph/database

final int[] symbol = decoderInputs.getSymbols();
origin: com.blazegraph/bigdata-core

final int[] symbol = decoderInputs.getSymbols();
origin: com.blazegraph/bigdata-core-test

    .getLengths());
assertEquals("symbol[]", decoderInputs.getSymbols(), actualInputs
    .getSymbols());
origin: com.blazegraph/bigdata-core

          .getSymbols());
} else {
origin: blazegraph/database

          .getSymbols());
} else {
origin: com.blazegraph/bigdata-core-test

decoderInputs.getLengths(), decoderInputs.getSymbols());
origin: blazegraph/database

decoderInputs.getLengths(), decoderInputs.getSymbols());
origin: blazegraph/database

    .getLengths());
assertEquals("symbol[]", decoderInputs.getSymbols(), actualInputs
    .getSymbols());
origin: com.blazegraph/bigdata-core-test

/**
 * Unit test for processing an {@link IRaba} representing B+Tree keys
 * suitable to setup the data for compression.
 * 
 * @throws IOException 
 */
public void test_keyRabaSetup() throws IOException {
  final int n = 8;
  final byte[][] a = new byte[n][];
  a[0] = new byte[]{1,2};
  a[1] = new byte[]{1,2,3};
  a[2] = new byte[]{1,3};
  a[3] = new byte[]{1,3,1};
  a[4] = new byte[]{1,3,3};
  a[5] = new byte[]{1,3,7};
  a[6] = new byte[]{1,5};
  a[7] = new byte[]{1,6,0};
  
  final IRaba raba = new ReadOnlyKeysRaba(a);
  final AbstractCodingSetup setup = new RabaCodingSetup(raba);
  doDecoderInputRoundTripTest(setup.getSymbolCount(), setup
      .decoderInputs());
  // verify that we can re-create the coder.
  doCoderRoundTripTest(setup.codec().codeWords(), setup.decoderInputs()
      .getShortestCodeWord(), setup.decoderInputs().getLengths(),
      setup.decoderInputs().getSymbols());
}
origin: blazegraph/database

/**
 * Unit test for processing an {@link IRaba} representing B+Tree keys
 * suitable to setup the data for compression.
 * 
 * @throws IOException 
 */
public void test_keyRabaSetup() throws IOException {
  final int n = 8;
  final byte[][] a = new byte[n][];
  a[0] = new byte[]{1,2};
  a[1] = new byte[]{1,2,3};
  a[2] = new byte[]{1,3};
  a[3] = new byte[]{1,3,1};
  a[4] = new byte[]{1,3,3};
  a[5] = new byte[]{1,3,7};
  a[6] = new byte[]{1,5};
  a[7] = new byte[]{1,6,0};
  
  final IRaba raba = new ReadOnlyKeysRaba(a);
  final AbstractCodingSetup setup = new RabaCodingSetup(raba);
  doDecoderInputRoundTripTest(setup.getSymbolCount(), setup
      .decoderInputs());
  // verify that we can re-create the coder.
  doCoderRoundTripTest(setup.codec().codeWords(), setup.decoderInputs()
      .getShortestCodeWord(), setup.decoderInputs().getLengths(),
      setup.decoderInputs().getSymbols());
}
origin: com.blazegraph/bigdata-core-test

/**
 * Unit test for processing an {@link IRaba} representing B+Tree values
 * suitable to setup the data for compression.
 * 
 * @throws IOException 
 * 
 * @todo test w/ nulls.
 */
public void test_valueRabaSetup() throws IOException {
  final int n = 3;
  final byte[][] a = new byte[n][];
  a[0] = new byte[]{2,3};
  a[1] = new byte[]{3,5};
  a[2] = new byte[]{'m','i','k','e'};
  
  final IRaba raba = new ReadOnlyValuesRaba(a);
  final RabaCodingSetup setup = new RabaCodingSetup(raba);
  
  // verify that we can re-create the decoder.
  doDecoderInputRoundTripTest(setup.getSymbolCount(), setup
      .decoderInputs());
  // verify that we can re-create the coder.
  doCoderRoundTripTest(setup.codec().codeWords(), setup.decoderInputs()
      .getShortestCodeWord(), setup.decoderInputs().getLengths(),
      setup.decoderInputs().getSymbols());
}
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

/**
 * 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

/**
 * Unit test for processing an {@link IRaba} representing B+Tree values
 * suitable to setup the data for compression.
 * 
 * @throws IOException 
 * 
 * @todo test w/ nulls.
 */
public void test_valueRabaSetup() throws IOException {
  final int n = 3;
  final byte[][] a = new byte[n][];
  a[0] = new byte[]{2,3};
  a[1] = new byte[]{3,5};
  a[2] = new byte[]{'m','i','k','e'};
  
  final IRaba raba = new ReadOnlyValuesRaba(a);
  final RabaCodingSetup setup = new RabaCodingSetup(raba);
  
  // verify that we can re-create the decoder.
  doDecoderInputRoundTripTest(setup.getSymbolCount(), setup
      .decoderInputs());
  // verify that we can re-create the coder.
  doCoderRoundTripTest(setup.codec().codeWords(), setup.decoderInputs()
      .getShortestCodeWord(), setup.decoderInputs().getLengths(),
      setup.decoderInputs().getSymbols());
}
origin: com.blazegraph/dsi-utils

/**
 * (Re-)constructs the canonical huffman code from the shortest code word,
 * the non-decreasing bit lengths of each code word, and the permutation of
 * the symbols corresponding to those bit lengths. This information is
 * necessary and sufficient to reconstruct a canonical huffman code.
 * 
 * @param decoderInputs
 *            This contains the necessary and sufficient information to
 *            recreate the {@link PrefixCoder}.
 * 
 * @return A new {@link PrefixCoder} instance for the corresponding
 *         canonical huffman code.
 */
static public PrefixCoder newCoder(final DecoderInputs decoderInputs) {
  return newCoder(decoderInputs.getShortestCodeWord(), decoderInputs
      .getLengths(), decoderInputs.getSymbols());
}
origin: blazegraph/database

/**
 * (Re-)constructs the canonical huffman code from the shortest code word,
 * the non-decreasing bit lengths of each code word, and the permutation of
 * the symbols corresponding to those bit lengths. This information is
 * necessary and sufficient to reconstruct a canonical huffman code.
 * 
 * @param decoderInputs
 *            This contains the necessary and sufficient information to
 *            recreate the {@link PrefixCoder}.
 * 
 * @return A new {@link PrefixCoder} instance for the corresponding
 *         canonical huffman code.
 */
static public PrefixCoder newCoder(final DecoderInputs decoderInputs) {
  return newCoder(decoderInputs.getShortestCodeWord(), decoderInputs
      .getLengths(), decoderInputs.getSymbols());
}
it.unimi.dsi.compressionHuffmanCodec$DecoderInputsgetSymbols

Javadoc

Return the symbol[] in the permuted order used to construct the CanonicalFast64CodeWordDecoder. This information is transient.

Popular methods of HuffmanCodec$DecoderInputs

  • <init>
    Ctor may be used to explicitly populate an instance with the caller's data.
  • getLengths
    Return the codeWord bit lengths in the non-decreasing order used to construct the CanonicalFast64Cod
  • getShortestCodeWord
    The shortest code word. Note that canonical huffman codes can be recreated from just length[0] and t

Popular in Java

  • Start an intent from android
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Runner (org.openjdk.jmh.runner)
  • 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