org.apache.sysds.runtime.compress.colgroup

## Class ColGroupCompressed

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

All Implemented Interfaces:
  Serializable

Direct Known Subclasses:
  ColGroupConst, ColGroupEmpty, ColGroupValue

    public abstract class ColGroupCompressed
    extends AColGroup

Base class for column groups encoded Encoded in a compressed manner.

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 Instance Methods Abstract Methods Concrete Methods
`void` `computeColSums(double[] c, int nRows)` Compute the column sum
`double` `getMax()` Short hand method for getting maximum value contained in this column group.
`double` `getMin()` Short hand method for getting minimum value contained in this column group.
`abstract double[]` `getValues()` Get all the values in the colGroup.
`abstract boolean` `isLossy()` Is Lossy
`void` `tsmm(MatrixBlock ret, int nRows)` Do a transposed self matrix multiplication on the left side t(x) %*% x.
`void` `unaryAggregateOperations(AggregateUnaryOperator op, double[] c, int nRows, int rl, int ru)` Unary Aggregate operator, since aggregate operators require new object output, the output becomes an uncompressed matrix.

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

`binaryRowOp, colSum, containsValue, copy, countNonZerosPerRow, decompressToBlock, decompressToBlock, estimateInMemorySize, get, getColIndices, getCompType, getExactSizeOnDisk, getNumberNonZeros, getNumCols, getNumValues, getValuesAsBlock, isDense, leftMultByAColGroup, leftMultByMatrix, leftMultByMatrix, readFields, replace, rightMultByMatrix, scalarOperation, shiftColIndices, sliceColumn, sliceColumns, toString, tsmmAColGroup, write`

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

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

### Method Detail

#### getValues

    public abstract double[] getValues()

Description copied from class: `AColGroup`
Get all the values in the colGroup. Note that this is only the stored values not the way they are stored. Making the output a list of values used in that colGroup not the actual full column.

Specified by:
  `getValues` in class `AColGroup`
Returns:
  a double list of values.

#### isLossy

    public abstract boolean isLossy()

Description copied from class: `AColGroup`
Is Lossy

Specified by:
  `isLossy` in class `AColGroup`
Returns:
  returns if the ColGroup is compressed in a lossy manner.

#### getMin

    public double getMin()

Description copied from class: `AColGroup`
Short hand method for getting minimum value contained in this column group.

Specified by:
  `getMin` in class `AColGroup`
Returns:
  The minimum value contained in this ColumnGroup

#### getMax

    public double getMax()

Description copied from class: `AColGroup`
Short hand method for getting maximum value contained in this column group.

Specified by:
  `getMax` in class `AColGroup`
Returns:
  The maximum value contained in this ColumnGroup

#### computeColSums

    public void computeColSums(double[] c,
                               int nRows)

Description copied from class: `AColGroup`
Compute the column sum

Specified by:
  `computeColSums` in class `AColGroup`
Parameters:
  `c` - The array to add the column sum to.
  `nRows` - The number of rows in the column group.

#### unaryAggregateOperations

    public final void unaryAggregateOperations(AggregateUnaryOperator op,
                                               double[] c,
                                               int nRows,
                                               int rl,
                                               int ru)

Description copied from class: `AColGroup`
Unary Aggregate operator, since aggregate operators require new object output, the output becomes an uncompressed matrix.

Specified by:
  `unaryAggregateOperations` in class `AColGroup`
Parameters:
  `op` - The operator used
  `c` - The output matrix block
  `nRows` - The total number of rows in the Column Group
  `rl` - The Starting Row to do aggregation from
  `ru` - The last Row to do aggregation to (not included)

#### tsmm

    public final void tsmm(MatrixBlock ret,
                           int nRows)

Description copied from class: `AColGroup`
Do a transposed self matrix multiplication on the left side t(x) %*% x. but only with this column group. This gives better performance since there is no need to iterate through all the rows of the matrix, but the execution can be limited to its number of distinct values. Note it only calculate the upper triangle

Specified by:
  `tsmm` in class `AColGroup`
Parameters:
  `ret` - The return matrix block [numColumns x numColumns]
  `nRows` - The number of rows in the column group