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

# Class ColGroupDeltaDDC

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
org.apache.sysds.runtime.compress.colgroup.ColGroupDDC
org.apache.sysds.runtime.compress.colgroup.ColGroupDeltaDDC

All Implemented Interfaces:
  `Serializable`, `IContainADictionary`, `IMapToDataGroup`

public class ColGroupDeltaDDC extends ColGroupDDC
Class to encapsulate information about a column group that is first delta encoded then encoded with dense dictionary encoding (DeltaDDC).

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
`AColGroup`
`append(AColGroup g)`
Append the other column group to this column group.
`AColGroup`
`appendNInternal(AColGroup[] g, int blen, int rlen)`
`boolean`
`containsValue(double pattern)`
Detect if the column group contains a specific value.
`static AColGroup`
`create(IColIndex colIndexes, IDictionary dict, AMapToData data, int[] cachedCounts)`
`org.apache.sysds.runtime.compress.colgroup.AColGroup.ColGroupType`
`getColGroupType()`
`AColGroup.CompressionType`
`getCompType()`
Obtain the compression type.
`long`
`getNumberNonZeros(int nRows)`
Get the number of nonZeros contained in this column group.
`void`
`leftMultByMatrixNoPreAgg(MatrixBlock matrix, MatrixBlock result, int rl, int ru, int cl, int cu)`
Left multiply with this column group.
`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)
`void`
`preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)`
`void`
`preAggregateThatDDCStructure(ColGroupDDC that, Dictionary ret)`
`void`
`preAggregateThatSDCSingleZerosStructure(ColGroupSDCSingleZeros that, Dictionary ret)`
`void`
`preAggregateThatSDCZerosStructure(ColGroupSDCZeros that, Dictionary ret)`
`static ColGroupDeltaDDC`
`read(DataInput in)`
`void`
`rightDecompressingMult(MatrixBlock right, MatrixBlock ret, int rl, int ru, int nRows, int crl, int cru)`
Right side Matrix multiplication, iterating though this column group and adding to the ret
`AColGroup`
`scalarOperation(ScalarOperator op)`
Perform the specified scalar operation directly on the compressed column group, without decompressing individual cells if possible.
`AColGroup`
`sliceRows(int rl, int ru)`
Slice range of rows out of the column group and return a new column group only containing the row segment.
`AColGroup`
`unaryOperation(UnaryOperator op)`
Perform unary operation on the column group and return a new column group

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

`binaryRowOpLeft, binaryRowOpRight, combineWithSameIndex, combineWithSameIndex, convertToDDCLZW, convertToDeltaDDC, estimateInMemorySize, getCompressionInfo, getCompressionScheme, getCost, getCounts, getEncoding, getExactSizeOnDisk, getIdx, getMapToData, leftMMIdentityPreAggregateDense, morph, recompress, removeEmptyRows, sameIndexStructure, sort, sparseSelection, sparsifyFOR, splitReshape, splitReshapePushDown, toString, write`

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

`getPreAggregateSize, leftMultByAColGroup, mmWithDictionary, preAggregate, preAggregateThatIndexStructure, tsmmAColGroup`

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

`centralMoment, clear, computeColSums, getCounts, getNumValues, replace, rexpandCols`

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

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

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

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

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

`addVector, appendN, colSum, combine, decompressToDenseBlock, decompressToSparseBlock, get, getColIndices, getNumCols, removeEmptyCols, rightMultByMatrix, selectionMultiply, shiftColIndices, sliceColumn, sliceColumns, sortColumnIndexes`

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

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

## Method Details

### create

public static AColGroup create(IColIndex colIndexes, IDictionary dict, AMapToData data, int[] cachedCounts)

### getCompType

public AColGroup.CompressionType getCompType()
Description copied from class: `AColGroup`
Obtain the compression type.

Overrides:
  `getCompType` in class `ColGroupDDC`
Returns:
  How the elements of the column group are compressed.

### getColGroupType

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

Overrides:
  `getColGroupType` in class `ColGroupDDC`

### read

public static ColGroupDeltaDDC read(DataInput in) throws IOException

Throws:
  `IOException`

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

Overrides:
  `scalarOperation` in class `ColGroupDDC`
Parameters:
  `op` - operation to perform
Returns:
  version of this column group with the operation applied

### unaryOperation

public AColGroup unaryOperation(UnaryOperator op)
Description copied from class: `AColGroup`
Perform unary operation on the column group and return a new column group

Overrides:
  `unaryOperation` in class `ColGroupDDC`
Parameters:
  `op` - The operation to perform
Returns:
  The new column group

### leftMultByMatrixNoPreAgg

public void leftMultByMatrixNoPreAgg(MatrixBlock matrix, MatrixBlock result, int rl, int ru, int cl, int cu)
Description copied from class: `AColGroup`
Left multiply with this column group.

Overrides:
  `leftMultByMatrixNoPreAgg` in class `ColGroupDDC`
Parameters:
  `matrix` - The matrix to multiply with on the left
  `result` - The result to output the values into, always dense for the purpose of the column groups parallelizing
  `rl` - The row to begin the multiplication from on the lhs matrix
  `ru` - The row to end the multiplication at on the lhs matrix
  `cl` - The column to begin the multiplication from on the lhs matrix
  `cu` - The column to end the multiplication at on the lhs matrix

### rightDecompressingMult

public void rightDecompressingMult(MatrixBlock right, MatrixBlock ret, int rl, int ru, int nRows, int crl, int cru)
Description copied from class: `AColGroup`
Right side Matrix multiplication, iterating though this column group and adding to the ret

Overrides:
  `rightDecompressingMult` in class `ColGroupDDC`
Parameters:
  `right` - Right side matrix to multiply with.
  `ret` - The return matrix to add results to
  `rl` - The row of this column group to multiply from
  `ru` - The row of this column group to multiply to (not inclusive)
  `nRows` - The number of rows in this column group
  `crl` - The right hand side column lower
  `cru` - The right hand side column upper

### preAggregateDense

public void preAggregateDense(MatrixBlock m, double[] preAgg, int rl, int ru, int cl, int cu)
Description copied from class: `APreAgg`
Pre aggregate a dense matrix block into a pre aggregate target (first step of left matrix multiplication)

Overrides:
  `preAggregateDense` in class `ColGroupDDC`
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 void preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)

Overrides:
  `preAggregateSparse` in class `ColGroupDDC`

### preAggregateThatDDCStructure

public void preAggregateThatDDCStructure(ColGroupDDC that, Dictionary ret)

Overrides:
  `preAggregateThatDDCStructure` in class `ColGroupDDC`

### preAggregateThatSDCZerosStructure

public void preAggregateThatSDCZerosStructure(ColGroupSDCZeros that, Dictionary ret)

Overrides:
  `preAggregateThatSDCZerosStructure` in class `ColGroupDDC`

### preAggregateThatSDCSingleZerosStructure

public void preAggregateThatSDCSingleZerosStructure(ColGroupSDCSingleZeros that, Dictionary ret)

Overrides:
  `preAggregateThatSDCSingleZerosStructure` in class `ColGroupDDC`

### containsValue

public boolean containsValue(double pattern)
Description copied from class: `AColGroup`
Detect if the column group contains a specific value.

Overrides:
  `containsValue` in class `ColGroupDDC`
Parameters:
  `pattern` - The value to look for.
Returns:
  boolean saying true if the value is contained.

### append

public AColGroup append(AColGroup g)
Description copied from class: `AColGroup`
Append the other column group to this column group. This method tries to combine them to return a new column group containing both. In some cases it is possible in reasonable time, in others it is not. The result is first this column group followed by the other column group in higher row values. If it is not possible or very inefficient null is returned.

Overrides:
  `append` in class `ColGroupDDC`
Parameters:
  `g` - The other column group
Returns:
  A combined column group or null

### appendNInternal

public AColGroup appendNInternal(AColGroup[] g, int blen, int rlen)

Overrides:
  `appendNInternal` in class `ColGroupDDC`

### getNumberNonZeros

public long getNumberNonZeros(int nRows)
Description copied from class: `AColGroup`
Get the number of nonZeros contained in this column group.

Overrides:
  `getNumberNonZeros` in class `AColGroupValue`
Parameters:
  `nRows` - The number of rows in the column group, this is used for groups that does not contain information about how many rows they have.
Returns:
  The nnz.

### sliceRows

public AColGroup sliceRows(int rl, int ru)
Description copied from class: `AColGroup`
Slice range of rows out of the column group and return a new column group only containing the row segment. Note that this slice should maintain pointers back to the original dictionaries and only modify index structures.

Overrides:
  `sliceRows` in class `ColGroupDDC`
Parameters:
  `rl` - The row to start at
  `ru` - The row to end at (not included)
Returns:
  A new column group containing the specified row range.