public class ColGroupUncompressed extends ColGroup
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[] colIndexTargets)
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
|
double |
get(int r,
int c)
Get the value at a global row/column position.
|
ColGroup.CompressionType |
getCompType()
Obtain the compression type.
|
MatrixBlock |
getData()
Access for superclass
|
long |
getExactSizeOnDisk()
Returns the exact serialized size of column group.
|
boolean |
getIfCountsType()
Returns true if in the getValuesAsBlock method returns values in groups (that needs to be counted) or
individually potentially repeated values
|
Iterator<IJV> |
getIterator(int rl,
int ru,
boolean inclZeros,
boolean rowMajor)
Create a column group iterator for a row index range.
|
org.apache.sysds.runtime.compress.colgroup.ColGroup.ColGroupRowIterator |
getRowIterator(int rl,
int ru)
Create a dense row iterator for a row index range.
|
double[] |
getValues()
Get all the values in the colGroup.
|
MatrixBlock |
getValuesAsBlock()
Returns the ColGroup as a MatrixBlock.
|
long |
getValuesSize() |
boolean |
isLossy()
Is Lossy
|
void |
leftMultByMatrix(double[] vector,
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 |
leftMultByMatrix(MatrixBlock matrix,
MatrixBlock result) |
void |
leftMultByRowVector(double[] vector,
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[] vector,
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 |
rightMultByMatrix(MatrixBlock vector,
MatrixBlock result,
int rl,
int ru) |
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.
|
void |
rightMultByVector(MatrixBlock vector,
MatrixBlock result,
int rl,
int ru) |
ColGroup |
scalarOperation(ScalarOperator op)
Perform the specified scalar operation directly on the compressed column group, without decompressing individual
cells if possible.
|
String |
toString() |
void |
unaryAggregateOperations(AggregateUnaryOperator op,
double[] ret)
Unary Aggregate operator, since aggregate operators require new object output, the output becomes an uncompressed
matrix.
|
void |
unaryAggregateOperations(AggregateUnaryOperator op,
double[] result,
int rl,
int ru)
Unary Aggregate operator, since aggregate operators require new object output, the output becomes an uncompressed
matrix.
|
void |
unaryAggregateOperations(AggregateUnaryOperator op,
MatrixBlock ret) |
void |
write(DataOutput out)
Serializes column group to data output.
|
getColIndex, getColIndices, getNumCols, getNumRows, shiftColIndices
public long getValuesSize()
public ColGroup.CompressionType getCompType()
ColGroup
getCompType
in class ColGroup
public MatrixBlock getData()
public long estimateInMemorySize()
ColGroup
estimateInMemorySize
in class ColGroup
public void decompressToBlock(MatrixBlock target, int rl, int ru)
ColGroup
decompressToBlock
in class ColGroup
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[] colIndexTargets)
ColGroup
decompressToBlock
in class ColGroup
target
- a dense matrix block. The block must have enough space to hold the contents of this column
group.colIndexTargets
- 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 ColGroup
target
- dense output vectorcolpos
- column to decompress, error if larger or equal numColspublic double get(int r, int c)
ColGroup
public 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 rightMultByVector(MatrixBlock vector, MatrixBlock result, int rl, int ru)
public void rightMultByMatrix(MatrixBlock vector, MatrixBlock result, int rl, int ru)
public void rightMultByMatrix(double[] matrix, double[] result, int numVals, double[] values, int rl, int ru, int vOff)
rightMultByMatrix
in class ColGroup
public void leftMultByRowVector(double[] vector, double[] c, int numVals)
ColGroup
leftMultByRowVector
in class ColGroup
vector
- row vectorc
- matrix block resultnumVals
- The Number of values contained in the Column.public void leftMultByRowVector(double[] vector, double[] c, int numVals, double[] values)
ColGroup
leftMultByRowVector
in class ColGroup
vector
- 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[] vector, double[] c, int numVals, double[] values, int numRows, int numCols, int rl, int ru, int vOff)
ColGroup
leftMultByMatrix
in class ColGroup
vector
- 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 leftMultByMatrix(MatrixBlock matrix, MatrixBlock result)
public ColGroup scalarOperation(ScalarOperator op)
ColGroup
scalarOperation
in class ColGroup
op
- operation to performpublic void unaryAggregateOperations(AggregateUnaryOperator op, double[] ret)
ColGroup
unaryAggregateOperations
in class ColGroup
op
- The operator usedret
- Rhe output matrix block.public void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock ret)
public void unaryAggregateOperations(AggregateUnaryOperator op, double[] result, int rl, int ru)
ColGroup
unaryAggregateOperations
in class ColGroup
op
- The operator usedresult
- The output matrix block.rl
- The Starting Row to do aggregation fromru
- The last Row to do aggregation to (not included)public void readFields(DataInput in) throws IOException
ColGroup
readFields
in class ColGroup
in
- data inputIOException
- if IOException occurspublic void write(DataOutput out) throws IOException
ColGroup
write
in class ColGroup
out
- data outputIOException
- if IOException occurspublic long getExactSizeOnDisk()
ColGroup
getExactSizeOnDisk
in class ColGroup
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 Iterator<IJV> getIterator(int rl, int ru, boolean inclZeros, boolean rowMajor)
ColGroup
getIterator
in class ColGroup
rl
- row lower index, inclusiveru
- row upper index, exclusiveinclZeros
- include zero values into scope of iteratorrowMajor
- use a row major iteration orderpublic 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 MatrixBlock getValuesAsBlock()
ColGroup
getValuesAsBlock
in class ColGroup
public boolean getIfCountsType()
ColGroup
getIfCountsType
in class ColGroup
public double[] getValues()
ColGroup
Copyright © 2020 The Apache Software Foundation. All rights reserved.