org.apache.sysds.runtime.compress.colgroup

## Class ColGroupOLE

- java.lang.Object
- - org.apache.sysds.runtime.compress.colgroup.AColGroup
  - - org.apache.sysds.runtime.compress.colgroup.ColGroupCompressed
    - - org.apache.sysds.runtime.compress.colgroup.ColGroupValue
      - - org.apache.sysds.runtime.compress.colgroup.ColGroupOffset
        - - org.apache.sysds.runtime.compress.colgroup.ColGroupOLE

- All Implemented Interfaces:
    Serializable, Cloneable

      public class ColGroupOLE
      extends ColGroupOffset

  Class to encapsulate information about a column group that is encoded with simple lists of offsets for each set of distinct values.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.sysds.runtime.compress.colgroup.AColGroup

      `AColGroup.CompressionType`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AColGroup` | `binaryRowOp(BinaryOperator op, double[] v, boolean sparseSafe, boolean left)` Perform a binary row operation.
    `void` | `countNonZerosPerRow(int[] rnnz, int rl, int ru)` Count the number of non-zeros per row
    `static char[]` | `genOffsetBitmap(int[] offsets, int len)` Encodes the bitmap in blocks of offsets.
    `double` | `get(int r, int c)` Get the value at a global row/column position.
    `org.apache.sysds.runtime.compress.colgroup.AColGroup.ColGroupType` | `getColGroupType()` Internally get the specific type of ColGroup, this could be extracted from the object but that does not allow for nice switches in the code.
    `AColGroup.CompressionType` | `getCompType()` Obtain the compression type.
    `int[]` | `getCounts(int[] counts)`
    `int[]` | `getCounts(int rl, int ru, int[] counts)`
    `int` | `getIndexStructureHash()`
    `void` | `preAggregate(MatrixBlock m, MatrixBlock preAgg, int rl, int ru)` Pre aggregate for left Multiplication.
    `void` | `preAggregateDense(MatrixBlock m, MatrixBlock preAgg, int rl, int ru, int vl, int vu)`
    `Dictionary` | `preAggregateThatDDCStructure(ColGroupDDC that, Dictionary ret)`
    `Dictionary` | `preAggregateThatSDCSingleStructure(ColGroupSDCSingle that, Dictionary ret, boolean preModified)`
    `Dictionary` | `preAggregateThatSDCSingleZerosStructure(ColGroupSDCSingleZeros that, Dictionary ret)`
    `Dictionary` | `preAggregateThatSDCStructure(ColGroupSDC that, Dictionary ret, boolean preModified)`
    `Dictionary` | `preAggregateThatSDCZerosStructure(ColGroupSDCZeros that, Dictionary ret)`
    `boolean` | `sameIndexStructure(ColGroupCompressed that)`
    `AColGroup` | `scalarOperation(ScalarOperator op)` Perform the specified scalar operation directly on the compressed column group, without decompressing individual cells if possible.
    `String` | `toString()`

    - ### Methods inherited from class org.apache.sysds.runtime.compress.colgroup.ColGroupOffset

      `estimateInMemorySize, getBitmapOffsets, getBitmaps, getExactSizeOnDisk, hasZeros, readFields, write`

    - ### Methods inherited from class org.apache.sysds.runtime.compress.colgroup.ColGroupValue

      `addMatrixToResult, addMinMax, allocatePreAggregate, cleanupThreadLocalMemory, containsValue, copy, copyAndSet, copyAndSet, copyAndSet, copyAndSet, decompressToBlockSafe, decompressToBlockUnSafe, getCachedCounts, getCounts, getCounts, getDictionary, getIfCountsType, getNumberNonZeros, getNumValues, getValues, getValuesAsBlock, isDense, isLossy, leftMultByAColGroup, leftMultByMatrix, leftMultByPreAggregateMatrix, leftMultByPreAggregateMatrix, preAggregateThatIndexStructure, replace, rightMultByMatrix, setupLeftMultThreadLocalMemory, setupThreadLocalMemory, tsmm`

    - ### Methods inherited from class org.apache.sysds.runtime.compress.colgroup.ColGroupCompressed

      `getMax, getMin, getNumRows, unaryAggregateOperations, unaryAggregateOperations`

    - ### Methods inherited from class org.apache.sysds.runtime.compress.colgroup.AColGroup

      `decompressColumnToBlockUnSafe, decompressToBlockUnSafe, getColIndices, getNumCols, leftMultByMatrix, shiftColIndices, sliceColumn, sliceColumns`

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

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

- - ### Method Detail

    - #### getCompType

          public AColGroup.CompressionType getCompType()

      Description copied from class: `AColGroup`
      Obtain the compression type.
      Specified by:
        `getCompType` in class `AColGroup`
      Returns:
        How the elements of the column group are compressed.

    - #### getColGroupType

          public org.apache.sysds.runtime.compress.colgroup.AColGroup.ColGroupType getColGroupType()

      Description copied from class: `AColGroup`
      Internally get the specific type of ColGroup, this could be extracted from the object but that does not allow for nice switches in the code.
      Returns:
        ColGroupType of the object.

    - #### getCounts

          public int[] getCounts(int[] counts)

      Specified by:
        `getCounts` in class `ColGroupValue`

    - #### getCounts

          public int[] getCounts(int rl,
                                 int ru,
                                 int[] counts)

      Specified by:
        `getCounts` in class `ColGroupValue`

    - #### scalarOperation

          public AColGroup scalarOperation(ScalarOperator op)

      Description copied from class: `AColGroup`
      Perform the specified scalar operation directly on the compressed column group, without decompressing individual cells if possible.
      Specified by:
        `scalarOperation` in class `AColGroup`
      Parameters:
        `op` - operation to perform
      Returns:
        version of this column group with the operation applied

    - #### binaryRowOp

          public AColGroup binaryRowOp(BinaryOperator op,
                                       double[] v,
                                       boolean sparseSafe,
                                       boolean left)

      Description copied from class: `AColGroup`
      Perform a binary row operation.
      Specified by:
        `binaryRowOp` in class `AColGroup`
      Parameters:
        `op` - The operation to execute
        `v` - The vector of values to apply, should be same length as dictionary length.
        `sparseSafe` - True if the operation return 0 on all instances of values in v -- op(v[?], 0)
        `left` - Specifies if the operation is executed on the left or right side of the values contained.
      Returns:
        A updated column group with the new values.

    - #### countNonZerosPerRow

          public void countNonZerosPerRow(int[] rnnz,
                                          int rl,
                                          int ru)

      Description copied from class: `AColGroup`
      Count the number of non-zeros per row
      Specified by:
        `countNonZerosPerRow` in class `AColGroup`
      Parameters:
        `rnnz` - non-zeros per row
        `rl` - row lower bound, inclusive
        `ru` - row upper bound, exclusive

    - #### get

          public double get(int r,
                            int c)

      Description copied from class: `AColGroup`
      Get the value at a global row/column position.
      Specified by:
        `get` in class `AColGroup`
      Parameters:
        `r` - row
        `c` - column
      Returns:
        value at the row/column position

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `ColGroupOffset`

    - #### preAggregate

          public void preAggregate(MatrixBlock m,
                                   MatrixBlock preAgg,
                                   int rl,
                                   int ru)

      Description copied from class: `ColGroupValue`
      Pre aggregate for left Multiplication.
      Specified by:
        `preAggregate` in class `ColGroupValue`
      Parameters:
        `m` - Matrix to preAggregate
        `preAgg` - Matrix to preAggregate into
        `rl` - Start row
        `ru` - End row

    - #### preAggregateDense

          public void preAggregateDense(MatrixBlock m,
                                        MatrixBlock preAgg,
                                        int rl,
                                        int ru,
                                        int vl,
                                        int vu)

      Specified by:
        `preAggregateDense` in class `ColGroupValue`

    - #### sameIndexStructure

          public boolean sameIndexStructure(ColGroupCompressed that)

    - #### getIndexStructureHash

          public int getIndexStructureHash()

    - #### 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

    - #### preAggregateThatDDCStructure

          public Dictionary preAggregateThatDDCStructure(ColGroupDDC that,
                                                         Dictionary ret)

    - #### preAggregateThatSDCStructure

          public Dictionary preAggregateThatSDCStructure(ColGroupSDC that,
                                                         Dictionary ret,
                                                         boolean preModified)

    - #### preAggregateThatSDCZerosStructure

          public Dictionary preAggregateThatSDCZerosStructure(ColGroupSDCZeros that,
                                                              Dictionary ret)

    - #### preAggregateThatSDCSingleZerosStructure

          public Dictionary preAggregateThatSDCSingleZerosStructure(ColGroupSDCSingleZeros that,
                                                                    Dictionary ret)

    - #### preAggregateThatSDCSingleStructure

          public Dictionary preAggregateThatSDCSingleStructure(ColGroupSDCSingle that,
                                                               Dictionary ret,
                                                               boolean preModified)

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