org.apache.sysds.runtime.compress.colgroup

## Class ColGroupConst

- 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.ColGroupConst

- All Implemented Interfaces:
    Serializable, Cloneable

      public class ColGroupConst
      extends ColGroupValue

  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `AColGroup.CompressionType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ColGroupConst(int[] colIndices, int numRows, ADictionary dict)` Constructs an Constant Colum Group, that contains only one tuple, with the given value.

  - ### Method Summary

    All 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
    `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[] out)`
    `int[]` | `getCounts(int rl, int ru, int[] out)`
    `AColGroup` | `scalarOperation(ScalarOperator op)` Perform the specified scalar operation directly on the compressed column group, without decompressing individual cells if possible.

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

      `addMinMax, cleanupThreadLocalMemory, containsValue, copy, copyAndSet, copyAndSet, copyAndSet, copyAndSet, decompressToBlockSafe, decompressToBlockUnSafe, estimateInMemorySize, getCachedCounts, getCounts, getCounts, getDictionary, getExactSizeOnDisk, getIfCountsType, getNumberNonZeros, getNumValues, getValues, getValuesAsBlock, isDense, isLossy, leftMultByAColGroup, leftMultByMatrix, preAggregateThatIndexStructure, readFields, replace, rightMultByMatrix, setupThreadLocalMemory, toString, tsmm, tsmm, write`

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

- - ### Constructor Detail

    - #### ColGroupConst

          public ColGroupConst(int[] colIndices,
                               int numRows,
                               ADictionary dict)

      Constructs an Constant Colum Group, that contains only one tuple, with the given value.
      Parameters:
        `colIndices` - The Colum indexes for the column group.
        `numRows` - The number of rows contained in the group.
        `dict` - The dictionary containing one tuple for the entire compression.

  - ### Method Detail

    - #### getCounts

          public int[] getCounts(int[] out)

      Specified by:
        `getCounts` in class `ColGroupValue`

    - #### getCounts

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

      Specified by:
        `getCounts` in class `ColGroupValue`

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

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

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

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