Class ColGroupOLE
- java.lang.Object
-
- org.apache.sysds.runtime.compress.colgroup.AColGroup
-
- org.apache.sysds.runtime.compress.colgroup.AColGroupCompressed
-
- org.apache.sysds.runtime.compress.colgroup.AColGroupValue
-
- org.apache.sysds.runtime.compress.colgroup.AColGroupOffset
-
- org.apache.sysds.runtime.compress.colgroup.ColGroupOLE
-
- All Implemented Interfaces:
Serializable,Cloneable
public class ColGroupOLE extends AColGroupOffset
Class to encapsulate information about a column group that is encoded with simple lists of offsets for each set of distinct values.- 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 Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AColGroupbinaryRowOpLeft(BinaryOperator op, double[] v, boolean isRowSafe)Perform a binary row operation.AColGroupbinaryRowOpRight(BinaryOperator op, double[] v, boolean isRowSafe)Perform a binary row operation.voidcountNonZerosPerRow(int[] rnnz, int rl, int ru)static char[]genOffsetBitmap(int[] offsets, int len)Encodes the bitmap in blocks of offsets.org.apache.sysds.runtime.compress.colgroup.AColGroup.ColGroupTypegetColGroupType()AColGroup.CompressionTypegetCompType()Obtain the compression type.int[]getCounts(int[] counts)doublegetIdx(int r, int colIdx)Get the value at a colGroup specific row/column index position.voidleftMultByAColGroup(AColGroup lhs, MatrixBlock result)Left side matrix multiplication with a column group that is transposed.voidleftMultByMatrixNoPreAgg(MatrixBlock matrix, MatrixBlock result, int rl, int ru, int cl, int cu)Left multiply with this column group.AColGroupscalarOperation(ScalarOperator op)Perform the specified scalar operation directly on the compressed column group, without decompressing individual cells if possible.StringtoString()voidtsmmAColGroup(AColGroup other, MatrixBlock result)Matrix multiply with this other column group, but: 1.AColGroupunaryOperation(UnaryOperator op)-
Methods inherited from class org.apache.sysds.runtime.compress.colgroup.AColGroupOffset
estimateInMemorySize, getBitmapOffsets, getBitmaps, getCost, getExactSizeOnDisk, hasZeros, readFields, write
-
Methods inherited from class org.apache.sysds.runtime.compress.colgroup.AColGroupValue
centralMoment, computeColSums, containsValue, copy, decompressToDenseBlock, decompressToSparseBlock, forceMatrixBlockDictionary, getCachedCounts, getCounts, getDictionary, getNumberNonZeros, getNumValues, replace, rexpandCols, rightMultByMatrix
-
Methods inherited from class org.apache.sysds.runtime.compress.colgroup.AColGroupCompressed
getMax, getMin, preAggRows, tsmm, unaryAggregateOperations, unaryAggregateOperations
-
Methods inherited from class org.apache.sysds.runtime.compress.colgroup.AColGroup
colSum, decompressToDenseBlock, decompressToSparseBlock, get, getColIndices, getNumCols, shiftColIndices, sliceColumn, sliceColumns
-
-
-
-
Method Detail
-
getCompType
public AColGroup.CompressionType getCompType()
Description copied from class:AColGroupObtain the compression type.- Specified by:
getCompTypein classAColGroup- Returns:
- How the elements of the column group are compressed.
-
getColGroupType
public org.apache.sysds.runtime.compress.colgroup.AColGroup.ColGroupType getColGroupType()
-
getCounts
public int[] getCounts(int[] counts)
- Specified by:
getCountsin classAColGroupValue
-
scalarOperation
public AColGroup scalarOperation(ScalarOperator op)
Description copied from class:AColGroupPerform the specified scalar operation directly on the compressed column group, without decompressing individual cells if possible.- Specified by:
scalarOperationin classAColGroup- Parameters:
op- operation to perform- Returns:
- version of this column group with the operation applied
-
unaryOperation
public AColGroup unaryOperation(UnaryOperator op)
- Specified by:
unaryOperationin classAColGroup
-
binaryRowOpLeft
public AColGroup binaryRowOpLeft(BinaryOperator op, double[] v, boolean isRowSafe)
Description copied from class:AColGroupPerform a binary row operation.- Specified by:
binaryRowOpLeftin classAColGroup- Parameters:
op- The operation to executev- The vector of values to apply, should be same length as dictionary length.isRowSafe- True if the binary op is applied to an entire zero row and all results are zero- Returns:
- A updated column group with the new values.
-
binaryRowOpRight
public AColGroup binaryRowOpRight(BinaryOperator op, double[] v, boolean isRowSafe)
Description copied from class:AColGroupPerform a binary row operation.- Specified by:
binaryRowOpRightin classAColGroup- Parameters:
op- The operation to executev- The vector of values to apply, should be same length as dictionary length.isRowSafe- True if the binary op is applied to an entire zero row and all results are zero- Returns:
- A updated column group with the new values.
-
countNonZerosPerRow
public void countNonZerosPerRow(int[] rnnz, int rl, int ru)- Specified by:
countNonZerosPerRowin classAColGroupOffset
-
getIdx
public double getIdx(int r, int colIdx)Description copied from class:AColGroupGet the value at a colGroup specific row/column index position.
-
leftMultByMatrixNoPreAgg
public void leftMultByMatrixNoPreAgg(MatrixBlock matrix, MatrixBlock result, int rl, int ru, int cl, int cu)
Description copied from class:AColGroupLeft multiply with this column group.- Specified by:
leftMultByMatrixNoPreAggin classAColGroup- Parameters:
matrix- The matrix to multiply with on the leftresult- The result to output the values into, always dense for the purpose of the column groups parallelizingrl- The row to begin the multiplication from on the lhs matrixru- The row to end the multiplication at on the lhs matrixcl- The column to begin the multiplication from on the lhs matrixcu- The column to end the multiplication at on the lhs matrix
-
leftMultByAColGroup
public void leftMultByAColGroup(AColGroup lhs, MatrixBlock result)
Description copied from class:AColGroupLeft side matrix multiplication with a column group that is transposed.- Specified by:
leftMultByAColGroupin classAColGroup- Parameters:
lhs- The left hand side Column group to multiply with, the left hand side should be considered transposed.result- The result matrix to insert the result of the multiplication into
-
tsmmAColGroup
public void tsmmAColGroup(AColGroup other, MatrixBlock result)
Description copied from class:AColGroupMatrix 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:
tsmmAColGroupin classAColGroup- Parameters:
other- The other Column group to multiply withresult- The result matrix to put the results into
-
toString
public String toString()
- Overrides:
toStringin classAColGroupOffset
-
genOffsetBitmap
public static char[] genOffsetBitmap(int[] offsets, int len)Encodes the bitmap in blocks of offsets. Within each block, the bits are stored as absolute offsets from the start of the block.- Parameters:
offsets- uncompressed offset listlen- logical length of the given offset list- Returns:
- compressed version of said bitmap
-
-