org.apache.sysds.runtime.compress.utils

## Class BitmapLossy

- java.lang.Object
- - org.apache.sysds.runtime.compress.utils.ABitmap
  - - org.apache.sysds.runtime.compress.utils.BitmapLossy

-     public final class BitmapLossy
      extends ABitmap

  Uncompressed but Quantized representation of contained data.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.sysds.runtime.compress.utils.ABitmap

      `ABitmap.BitmapType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BitmapLossy(int numCols, IntArrayList[] offsetsLists, byte[] values, double scale, int rows)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getNumNonZerosInOffset(int idx)`
    `long` | `getNumOffsets()`
    `int` | `getNumOffsets(int ix)` Get the number of offsets for a specific unique offset.
    `int` | `getNumValues()` Obtain number of distinct values in the column.
    `IntArrayList` | `getOffsetsList(int ix)`
    `double` | `getScale()`
    `ABitmap.BitmapType` | `getType()`
    `byte[]` | `getValues()` Get all values without unnecessary allocations and copies.
    `byte[]` | `getValues(int ix)` Obtain tuple of column values associated with index.
    `boolean` | `lossy()`
    `void` | `sortValuesByFrequency()`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.sysds.runtime.compress.utils.ABitmap

      `containsZero, getNumColumns, getNumRows, getOffsetList, getZeroCounts, isEmpty`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BitmapLossy

          public BitmapLossy(int numCols,
                             IntArrayList[] offsetsLists,
                             byte[] values,
                             double scale,
                             int rows)

  - ### Method Detail

    - #### getValues

          public byte[] getValues()

      Get all values without unnecessary allocations and copies.
      Returns:
        dictionary of value tuples

    - #### getValues

          public byte[] getValues(int ix)

      Obtain tuple of column values associated with index.
      Parameters:
        `ix` - index of a particular distinct value
      Returns:
        the tuple of column values associated with the specified index

    - #### getNumNonZerosInOffset

          public int getNumNonZerosInOffset(int idx)

      Specified by:
        `getNumNonZerosInOffset` in class `ABitmap`

    - #### getScale

          public double getScale()

    - #### getNumValues

          public int getNumValues()

      Obtain number of distinct values in the column.
      Specified by:
        `getNumValues` in class `ABitmap`
      Returns:
        number of distinct values in the column; this number is also the number of bitmaps, since there is one bitmap per value

    - #### getOffsetsList

          public IntArrayList getOffsetsList(int ix)

      Overrides:
        `getOffsetsList` in class `ABitmap`

    - #### getNumOffsets

          public long getNumOffsets()

      Overrides:
        `getNumOffsets` in class `ABitmap`

    - #### getNumOffsets

          public int getNumOffsets(int ix)

      Description copied from class: `ABitmap`
      Get the number of offsets for a specific unique offset.
      Overrides:
        `getNumOffsets` in class `ABitmap`
      Parameters:
        `ix` - The offset index.
      Returns:
        The number of offsets for this unique value.

    - #### sortValuesByFrequency

          public void sortValuesByFrequency()

      Specified by:
        `sortValuesByFrequency` in class `ABitmap`

    - #### getType

          public ABitmap.BitmapType getType()

      Specified by:
        `getType` in class `ABitmap`

    - #### lossy

          public boolean lossy()

      Specified by:
        `lossy` in class `ABitmap`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `ABitmap`

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