Package org.apache.sysds.runtime.compress.colgroup

# Class APreAgg

java.lang.Object
org.apache.sysds.runtime.compress.colgroup.AColGroup
org.apache.sysds.runtime.compress.colgroup.AColGroupCompressed
org.apache.sysds.runtime.compress.colgroup.ADictBasedColGroup
org.apache.sysds.runtime.compress.colgroup.AColGroupValue
org.apache.sysds.runtime.compress.colgroup.APreAgg

All Implemented Interfaces:
  `Serializable`, `IContainADictionary`

Direct Known Subclasses:
  `AColGroupOffset`, `ASDCZero`, `ColGroupDDC`, `ColGroupDDCLZW`

public abstract class APreAgg extends AColGroupValue
Abstract class for all the column groups that use preAggregation for Left matrix multiplications.

See Also:
  - Serialized Form

## Nested Class Summary

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

`AColGroup.CompressionType`

## Method Summary

Modifier and Type
Method
Description
`int`
`getPreAggregateSize()`
`abstract void`
`leftMMIdentityPreAggregateDense(MatrixBlock that, MatrixBlock ret, int rl, int ru, int cl, int cu)`
`final void`
`leftMultByAColGroup(AColGroup lhs, MatrixBlock result, int nRows)`
Left side matrix multiplication with a column group that is transposed.
`void`
`mmWithDictionary(MatrixBlock preAgg, MatrixBlock tmpRes, MatrixBlock ret, int k, int rl, int ru)`
`final void`
`preAggregate(MatrixBlock m, double[] preAgg, int rl, int ru)`
Pre aggregate a matrix block into a pre aggregate target (first step of left matrix multiplication)
`abstract void`
`preAggregateDense(MatrixBlock m, double[] preAgg, int rl, int ru, int cl, int cu)`
Pre aggregate a dense matrix block into a pre aggregate target (first step of left matrix multiplication)
`abstract void`
`preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)`
`final IDictionary`
`preAggregateThatIndexStructure(APreAgg that)`
Pre aggregate into a dictionary.
`final void`
`tsmmAColGroup(AColGroup other, MatrixBlock result)`
Matrix multiply with this other column group, but: 1.

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

`centralMoment, clear, computeColSums, estimateInMemorySize, getCounts, getNumberNonZeros, getNumValues, replace, rexpandCols, toString`

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

`copyAndSet, copyAndSet, decompressToDenseBlock, decompressToDenseBlockTransposed, decompressToSparseBlock, decompressToSparseBlockTransposed, getDictionary, getExactSizeOnDisk, getSparsity, reduceCols, rightMultByMatrix, write`

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

`getMax, getMin, getSum, isEmpty, preAggRows, sameIndexStructure, sameIndexStructure, tsmm, unaryAggregateOperations, unaryAggregateOperations`

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

`addVector, append, appendN, binaryRowOpLeft, binaryRowOpRight, colSum, combine, combineWithSameIndex, combineWithSameIndex, containsValue, decompressToDenseBlock, decompressToSparseBlock, get, getColIndices, getCompressionInfo, getCompressionScheme, getCompType, getCost, getEncoding, getIdx, getNumCols, leftMultByMatrixNoPreAgg, morph, recompress, removeEmptyCols, removeEmptyRows, rightDecompressingMult, rightMultByMatrix, scalarOperation, selectionMultiply, shiftColIndices, sliceColumn, sliceColumns, sliceRows, sort, sortColumnIndexes, splitReshape, splitReshapePushDown, unaryOperation`

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

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

## Method Details

### tsmmAColGroup

public final void tsmmAColGroup(AColGroup other, MatrixBlock result)
Description copied from class: `AColGroup`
Matrix multiply with this other column group, but: 1. Only output upper triangle values. 2. Multiply both ways with "this" being on the left and on the right. It should be guaranteed that the input is not the same as the caller of the method. The second step is achievable by treating the initial multiplied matrix, and adding its values to the correct locations in the output.

Specified by:
  `tsmmAColGroup` in class `AColGroup`
Parameters:
  `other` - The other Column group to multiply with
  `result` - The result matrix to put the results into

### leftMultByAColGroup

public final void leftMultByAColGroup(AColGroup lhs, MatrixBlock result, int nRows)
Description copied from class: `AColGroup`
Left side matrix multiplication with a column group that is transposed.

Specified by:
  `leftMultByAColGroup` in class `AColGroup`
Parameters:
  `lhs` - The left hand side Column group to multiply with, the left hand side should be considered transposed. Also it should be guaranteed that this column group is not empty.
  `result` - The result matrix to insert the result of the multiplication into
  `nRows` - Number of rows in the lhs colGroup

### preAggregateThatIndexStructure

public final IDictionary preAggregateThatIndexStructure(APreAgg that)
Pre aggregate into a dictionary. It is assumed that "that" have more distinct values than, "this".

Parameters:
  `that` - the other column group whose indexes are used for aggregation.
Returns:
  A aggregate dictionary

### preAggregate

public final void preAggregate(MatrixBlock m, double[] preAgg, int rl, int ru)
Pre aggregate a matrix block into a pre aggregate target (first step of left matrix multiplication)

Parameters:
  `m` - The matrix to preAggregate
  `preAgg` - The preAggregate target
  `rl` - Row lower on the left side matrix
  `ru` - Row upper on the left side matrix

### preAggregateDense

public abstract void preAggregateDense(MatrixBlock m, double[] preAgg, int rl, int ru, int cl, int cu)
Pre aggregate a dense matrix block into a pre aggregate target (first step of left matrix multiplication)

Parameters:
  `m` - The matrix to preAggregate
  `preAgg` - The preAggregate target
  `rl` - Row lower on the left side matrix
  `ru` - Row upper on the left side matrix
  `cl` - Column lower on the left side matrix (or row lower in the column group)
  `cu` - Column upper on the left side matrix (or row upper in the column group)

### preAggregateSparse

public abstract void preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)

### getPreAggregateSize

public int getPreAggregateSize()

### mmWithDictionary

public void mmWithDictionary(MatrixBlock preAgg, MatrixBlock tmpRes, MatrixBlock ret, int k, int rl, int ru)

### leftMMIdentityPreAggregateDense

public abstract void leftMMIdentityPreAggregateDense(MatrixBlock that, MatrixBlock ret, int rl, int ru, int cl, int cu)