java.lang.Object
me.lemire.integercompression.S9

public final class S9 extends Object
This is a version of Simple9 optimized for NewPFOR, OptPFOR

Adapted by D. Lemire from the Apache Lucene project.

Author:
Daniel Lemire
  • Constructor Summary

    Constructors
    Constructor
    Description
    S9()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    compress(int[] in, int currentPos, int inlength, int[] out, int tmpoutpos)
    Compress an integer array using Simple9
    static int
    estimatecompress(int[] in, int currentPos, int inlength)
    Estimate size of the compressed output.
    static void
    uncompress(int[] in, int tmpinpos, int inlength, int[] out, int currentPos, int outlength)
    Uncompressed data from an input array into an output array

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • S9

      public S9()
  • Method Details

    • estimatecompress

      public static int estimatecompress(int[] in, int currentPos, int inlength)
      Estimate size of the compressed output.
      Parameters:
      in - array to compress
      currentPos - where to start reading
      inlength - how many integers to read
      Returns:
      estimated size of the output (in 32-bit integers)
    • compress

      public static int compress(int[] in, int currentPos, int inlength, int[] out, int tmpoutpos)
      Compress an integer array using Simple9
      Parameters:
      in - array to compress
      currentPos - where to start reading
      inlength - how many integers to read
      out - output array
      tmpoutpos - location in the output array
      Returns:
      the number of 32-bit words written (in compressed form)
    • uncompress

      public static void uncompress(int[] in, int tmpinpos, int inlength, int[] out, int currentPos, int outlength)
      Uncompressed data from an input array into an output array
      Parameters:
      in - input array (in compressed form)
      tmpinpos - starting location in the compressed input array
      inlength - how much data we wish the read (in 32-bit words)
      out - output array (in decompressed form)
      currentPos - current position in the output array
      outlength - available data in the output array