org.apache.sysds.runtime.compress.colgroup

## Class ColGroupDDC1

- java.lang.Object
- - org.apache.sysds.runtime.compress.colgroup.ColGroup
  - - org.apache.sysds.runtime.compress.colgroup.ColGroupValue
    - - org.apache.sysds.runtime.compress.colgroup.ColGroupDDC
      - - org.apache.sysds.runtime.compress.colgroup.ColGroupDDC1

- All Implemented Interfaces:
    Serializable

      public class ColGroupDDC1
      extends ColGroupDDC

  Class to encapsulate information about a column group that is encoded with dense dictionary encoding (DDC) using 1 byte codes.
  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `ColGroup.CompressionType`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `estimateInMemorySize()` Note: Must be overridden by child classes to account for additional data and metadata
    `byte[]` | `getData()` Getter method to get the data, contained in The DDC ColGroup.
    `long` | `getExactSizeOnDisk()` Returns the exact serialized size of column group.
    `void` | `readFields(DataInput in)` Deserialize column group from data input.
    `void` | `recodeData(HashMap<Double,Integer> map)`
    `void` | `rightMultByVector(double[] b, double[] c, int rl, int ru, double[] dictVals)` Multiply the slice of the matrix that this column group represents by a vector on the right.
    `ColGroup` | `scalarOperation(ScalarOperator op)` Perform the specified scalar operation directly on the compressed column group, without decompressing individual cells if possible.
    `String` | `toString()`
    `void` | `write(DataOutput out)` Serializes column group to data output.

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

      `countNonZerosPerRow, decompressToBlock, decompressToBlock, decompressToBlock, get, getCompType, getCounts, getCounts, getIterator, getRowIterator, leftMultByMatrix, leftMultByRowVector, leftMultByRowVector, postScaling, postScaling, preAggregate, preAggregate, rightMultByMatrix`

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

      `cleanupThreadLocalMemory, getByteValues, getCounts, getCounts, getIfCountsType, getNumValues, getValues, getValuesAsBlock, isLossy, setupThreadLocalMemory, unaryAggregateOperations, unaryAggregateOperations`

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

      `getColIndex, getColIndices, getNumCols, getNumRows, shiftColIndices`

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

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

- - ### Method Detail

    - #### getData

          public byte[] getData()

      Getter method to get the data, contained in The DDC ColGroup.
      Returns:
        The contained data

    - #### rightMultByVector

          public void rightMultByVector(double[] b,
                                        double[] c,
                                        int rl,
                                        int ru,
                                        double[] dictVals)

      Description copied from class: `ColGroup`
      Multiply the slice of the matrix that this column group represents by a vector on the right.
      Specified by:
        `rightMultByVector` in class `ColGroup`
      Parameters:
        `b` - vector to multiply by (tall vector)
        `c` - accumulator for holding the result
        `rl` - row lower
        `ru` - row upper if the internal SystemML code that performs the multiplication experiences an error
        `dictVals` - The dictionary values materialized

    - #### recodeData

          public void recodeData(HashMap<Double,Integer> map)

    - #### write

          public void write(DataOutput out)
                     throws IOException

      Description copied from class: `ColGroup`
      Serializes column group to data output.
      Overrides:
        `write` in class `ColGroupValue`
      Parameters:
        `out` - data output
      Throws:
        `IOException` - if IOException occurs

    - #### readFields

          public void readFields(DataInput in)
                          throws IOException

      Description copied from class: `ColGroup`
      Deserialize column group from data input.
      Overrides:
        `readFields` in class `ColGroupValue`
      Parameters:
        `in` - data input
      Throws:
        `IOException` - if IOException occurs

    - #### getExactSizeOnDisk

          public long getExactSizeOnDisk()

      Description copied from class: `ColGroup`
      Returns the exact serialized size of column group. This can be used for example for buffer preallocation.
      Overrides:
        `getExactSizeOnDisk` in class `ColGroupValue`
      Returns:
        exact serialized size for column group

    - #### estimateInMemorySize

          public long estimateInMemorySize()

      Description copied from class: `ColGroup`
      Note: Must be overridden by child classes to account for additional data and metadata
      Specified by:
        `estimateInMemorySize` in class `ColGroup`
      Returns:
        an upper bound on the number of bytes used to store this ColGroup in memory.

    - #### scalarOperation

          public ColGroup scalarOperation(ScalarOperator op)

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

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `ColGroupDDC`

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