public class ColGroupOLE extends ColGroupOffset
ColGroup.CompressionType
Modifier and Type | Method and Description |
---|---|
void |
countNonZerosPerRow(int[] rnnz,
int rl,
int ru)
Count the number of non-zeros per row
|
void |
decompressToBlock(MatrixBlock target,
int colpos)
Decompress to block.
|
void |
decompressToBlock(MatrixBlock target,
int[] colixTargets)
Decompress the contents of this column group into uncompressed packed columns
|
void |
decompressToBlock(MatrixBlock target,
int rl,
int ru)
Decompress the contents of this column group into the specified full matrix block.
|
long |
estimateInMemorySize()
Note: Must be overridden by child classes to account for additional data and metadata
|
static char[] |
genOffsetBitmap(int[] offsets,
int len)
Encodes the bitmap in blocks of offsets.
|
ColGroup.CompressionType |
getCompType()
Obtain the compression type.
|
int[] |
getCounts(int[] counts) |
int[] |
getCounts(int rl,
int ru,
int[] counts) |
long |
getExactSizeOnDisk()
Returns the exact serialized size of column group.
|
Iterator<Integer> |
getIterator(int k) |
Iterator<Integer> |
getIterator(int k,
int rl,
int ru) |
org.apache.sysds.runtime.compress.colgroup.ColGroup.ColGroupRowIterator |
getRowIterator(int rl,
int ru)
Create a dense row iterator for a row index range.
|
void |
leftMultByMatrix(double[] a,
double[] c,
int numVals,
double[] values,
int numRows,
int numCols,
int rl,
int ru,
int voff)
Multiply the slice of the matrix that this column group represents by a row vector on the left (the original
column vector is assumed to be transposed already i.e.
|
void |
leftMultByRowVector(double[] a,
double[] c,
int numVals)
Multiply the slice of the matrix that this column group represents by a row vector on the left (the original
column vector is assumed to be transposed already i.e.
|
void |
leftMultByRowVector(double[] a,
double[] c,
int numVals,
double[] values)
Multiply the slice of the matrix that this column group represents by a row vector on the left (the original
column vector is assumed to be transposed already i.e.
|
void |
readFields(DataInput in)
Deserialize column group from data input.
|
void |
rightMultByMatrix(double[] matrix,
double[] result,
int numVals,
double[] values,
int rl,
int ru,
int vOff) |
void |
rightMultByVector(double[] b,
double[] c,
int rl,
int ru,
double[] dictVals)
Multiply the slice of the matrix that this column group represents by a vector on the right.
|
ColGroup |
scalarOperation(ScalarOperator op)
Perform the specified scalar operation directly on the compressed column group, without decompressing individual
cells if possible.
|
String |
toString() |
void |
write(DataOutput out)
Serializes column group to data output.
|
get, getBitmapOffsets, getBitmaps, getIterator, hasZeros
cleanupThreadLocalMemory, getByteValues, getCounts, getCounts, getIfCountsType, getNumValues, getValues, getValuesAsBlock, isLossy, setupThreadLocalMemory, unaryAggregateOperations, unaryAggregateOperations
getColIndex, getColIndices, getNumCols, getNumRows, shiftColIndices
public ColGroup.CompressionType getCompType()
ColGroup
getCompType
in class ColGroup
public void decompressToBlock(MatrixBlock target, int rl, int ru)
ColGroup
decompressToBlock
in class ColGroupOffset
target
- a matrix block where the columns covered by this column group have not yet been filled in.rl
- row lowerru
- row upperpublic void decompressToBlock(MatrixBlock target, int[] colixTargets)
ColGroup
decompressToBlock
in class ColGroupOffset
target
- a dense matrix block. The block must have enough space to hold the contents of this column
group.colixTargets
- array that maps column indices in the original matrix block to columns of target.public void decompressToBlock(MatrixBlock target, int colpos)
ColGroup
decompressToBlock
in class ColGroupOffset
target
- dense output vectorcolpos
- column to decompress, error if larger or equal numColspublic int[] getCounts(int[] counts)
getCounts
in class ColGroupValue
public int[] getCounts(int rl, int ru, int[] counts)
getCounts
in class ColGroupValue
public long estimateInMemorySize()
ColGroup
estimateInMemorySize
in class ColGroupOffset
public ColGroup scalarOperation(ScalarOperator op)
ColGroup
scalarOperation
in class ColGroup
op
- operation to performpublic void rightMultByVector(double[] b, double[] c, int rl, int ru, double[] dictVals)
ColGroup
rightMultByVector
in class ColGroup
b
- vector to multiply by (tall vector)c
- accumulator for holding the resultrl
- row lowerru
- row upper if the internal SystemML code that performs the multiplication experiences an errordictVals
- The dictionary values materializedpublic void rightMultByMatrix(double[] matrix, double[] result, int numVals, double[] values, int rl, int ru, int vOff)
rightMultByMatrix
in class ColGroup
public void leftMultByRowVector(double[] a, double[] c, int numVals)
ColGroup
leftMultByRowVector
in class ColGroup
a
- row vectorc
- matrix block resultnumVals
- The Number of values contained in the Column.public void leftMultByRowVector(double[] a, double[] c, int numVals, double[] values)
ColGroup
leftMultByRowVector
in class ColGroup
a
- row vectorc
- matrix block resultnumVals
- The Number of values contained in the Column.values
- The materialized list of values contained in the dictionary.public void leftMultByMatrix(double[] a, double[] c, int numVals, double[] values, int numRows, int numCols, int rl, int ru, int voff)
ColGroup
leftMultByMatrix
in class ColGroup
a
- matrix to left multiplyc
- matrix block resultnumVals
- The Number of values contained in the Column.values
- The materialized list of values contained in the dictionary.numRows
- The number of rows in the matrix inputnumCols
- The number of columns in the colGroups parent matrix.rl
- The row to start the matrix multiplication fromru
- The row to stop the matrix multiplication at.voff
- The offset into the first argument matrix to start at.public void countNonZerosPerRow(int[] rnnz, int rl, int ru)
ColGroup
countNonZerosPerRow
in class ColGroup
rnnz
- non-zeros per rowrl
- row lower bound, inclusiveru
- row upper bound, exclusivepublic void readFields(DataInput in) throws IOException
ColGroup
readFields
in class ColGroupOffset
in
- data inputIOException
- if IOException occurspublic void write(DataOutput out) throws IOException
ColGroup
write
in class ColGroupOffset
out
- data outputIOException
- if IOException occurspublic long getExactSizeOnDisk()
ColGroup
getExactSizeOnDisk
in class ColGroupOffset
public Iterator<Integer> getIterator(int k)
getIterator
in class ColGroupOffset
k
- index of value tuple with associated bitmappublic Iterator<Integer> getIterator(int k, int rl, int ru)
getIterator
in class ColGroupOffset
k
- index of value tuple with associated bitmaprl
- row lower index, inclusiveru
- row upper index, exclusivepublic org.apache.sysds.runtime.compress.colgroup.ColGroup.ColGroupRowIterator getRowIterator(int rl, int ru)
ColGroup
getRowIterator
in class ColGroup
rl
- row lower index, inclusiveru
- row upper index, exclusivepublic String toString()
toString
in class ColGroupOffset
public static char[] genOffsetBitmap(int[] offsets, int len)
offsets
- uncompressed offset listlen
- logical length of the given offset listCopyright © 2020 The Apache Software Foundation. All rights reserved.