org.apache.sysml.runtime.compress

Class BitmapEncoder



  • public class BitmapEncoder
    extends Object
    Static functions for encoding bitmaps in various ways.
    • Field Detail

      • BITMAP_BLOCK_SZ

        public static final int BITMAP_BLOCK_SZ
        Size of the blocks used in a blocked bitmap representation.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BitmapEncoder

        public BitmapEncoder()
    • Method Detail

      • getAlignedBlocksize

        public static int getAlignedBlocksize(int blklen)
      • extractBitmap

        public static UncompressedBitmap extractBitmap(int[] colIndices,
                                                       MatrixBlock rawblock)
        Generate uncompressed bitmaps for a set of columns in an uncompressed matrix block.
        Parameters:
        colIndices - indexes (within the block) of the columns to extract
        rawblock - an uncompressed matrix block; can be dense or sparse
        Returns:
        uncompressed bitmap representation of the columns
      • extractBitmapFromSample

        public static UncompressedBitmap extractBitmapFromSample(int[] colIndices,
                                                                 MatrixBlock rawblock,
                                                                 int[] sampleIndexes)
      • genRLEBitmap

        public static char[] genRLEBitmap(int[] offsets,
                                          int len)
        Encodes the bitmap as a series of run lengths and offsets.
        Parameters:
        offsets - uncompressed offset list
        len - logical length of the given offset list
        Returns:
        compressed version of said bitmap
      • genOffsetBitmap

        public static char[] genOffsetBitmap(int[] offsets,
                                             int len)
        Encodes the bitmap in blocks of offsets. Within each block, the bits are stored as absolute offsets from the start of the block.
        Parameters:
        offsets - uncompressed offset list
        len - logical length of the given offset list
        Returns:
        compressed version of said bitmap

Copyright © 2017 The Apache Software Foundation. All rights reserved.