public class ColGroupUncompressed extends AColGroup
AColGroup.CompressionType
Constructor and Description |
---|
ColGroupUncompressed(int[] colIndicesList,
MatrixBlock rawBlock,
boolean transposed)
Main constructor for Uncompressed ColGroup.
|
Modifier and Type | Method and Description |
---|---|
AColGroup |
binaryRowOp(BinaryOperator op,
double[] v,
boolean sparseSafe,
boolean left)
Perform a binary row operation.
|
boolean |
containsValue(double pattern)
Detect if the column group contains a specific value.
|
AColGroup |
copy()
Get a copy of this column group.
|
void |
countNonZerosPerRow(int[] rnnz,
int rl,
int ru)
Count the number of non-zeros per row
|
void |
decompressToBlockSafe(MatrixBlock target,
int rl,
int ru,
int offT)
Decompress the contents of this column group into the specified full matrix block while managing the number of
non zeros.
|
void |
decompressToBlockUnSafe(MatrixBlock target,
int rl,
int ru,
int offT)
Decompress the contents of the columngroup unsafely, meaning that it does not count nonzero values.
|
long |
estimateInMemorySize()
Get the upper bound estimate of in memory allocation for the column group.
|
double |
get(int r,
int c)
Get the value at a global row/column position.
|
org.apache.sysds.runtime.compress.colgroup.AColGroup.ColGroupType |
getColGroupType()
Internally get the specific type of ColGroup, this could be extracted from the object but that does not allow for
nice switches in the code.
|
AColGroup.CompressionType |
getCompType()
Obtain the compression type.
|
MatrixBlock |
getData()
Access for superclass
|
long |
getExactSizeOnDisk()
Returns the exact serialized size of column group.
|
double |
getMax()
Short hand method for getting maximum value contained in this column group.
|
double |
getMin()
Short hand method for getting minimum value contained in this column group.
|
long |
getNumberNonZeros()
Get the number of nonZeros contained in this column group.
|
int |
getNumRows()
Get number of rows contained in the ColGroup.
|
int |
getNumValues()
Obtain number of distinct tuples in contained sets of values associated with this column group.
|
double[] |
getValues()
Get all the values in the colGroup.
|
MatrixBlock |
getValuesAsBlock()
Returns the ColGroup as a MatrixBlock.
|
boolean |
isDense()
Is dense, signals that the entire column group is allocated an processed.
|
boolean |
isLossy()
Is Lossy
|
void |
leftMultByAColGroup(AColGroup lhs,
MatrixBlock result)
Left side matrix multiplication with a column group that is transposed.
|
void |
leftMultByMatrix(MatrixBlock matrix,
MatrixBlock result,
int rl,
int ru)
Left multiply with this column group.
|
void |
readFields(DataInput in)
Deserialize column group from data input.
|
AColGroup |
replace(double pattern,
double replace)
Make a copy of the column group values, and replace all values that match pattern with replacement value.
|
AColGroup |
rightMultByMatrix(MatrixBlock right)
Right matrix multiplication with this column group.
|
AColGroup |
scalarOperation(ScalarOperator op)
Perform the specified scalar operation directly on the compressed column group, without decompressing individual
cells if possible.
|
String |
toString() |
void |
tsmm(double[] result,
int numColumns)
Do a transposed self matrix multiplication on the left side t(x) %*% x.
|
void |
tsmm(double[] result,
int numColumns,
int idxStart,
int idxEnd)
Do a transposed self matrix multiplication on the left side t(x) %*% x.
|
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 |
write(DataOutput out)
Serializes column group to data output.
|
decompressColumnToBlockUnSafe, decompressToBlockUnSafe, getColIndices, getNumCols, leftMultByMatrix, shiftColIndices, sliceColumn, sliceColumns
public ColGroupUncompressed(int[] colIndicesList, MatrixBlock rawBlock, boolean transposed)
colIndicesList
- Indices (relative to the current block) of the columns that this column group represents.rawBlock
- The uncompressed block; uncompressed data must be present at the time that the constructor
is calledtransposed
- Says if the input matrix raw block have been transposed.public AColGroup.CompressionType getCompType()
AColGroup
getCompType
in class AColGroup
public org.apache.sysds.runtime.compress.colgroup.AColGroup.ColGroupType getColGroupType()
AColGroup
public MatrixBlock getData()
public long estimateInMemorySize()
AColGroup
estimateInMemorySize
in class AColGroup
public void decompressToBlockSafe(MatrixBlock target, int rl, int ru, int offT)
AColGroup
decompressToBlockSafe
in class AColGroup
target
- a matrix block where the columns covered by this column group have not yet been filled in.rl
- row lowerru
- row upperoffT
- Offset into target to assign frompublic void decompressToBlockUnSafe(MatrixBlock target, int rl, int ru, int offT)
AColGroup
decompressToBlockUnSafe
in class AColGroup
target
- a matrix block where the columns covered by this column group have not yet been filled in.rl
- row lowerru
- row upperoffT
- Offset into target to assign frompublic double get(int r, int c)
AColGroup
public void leftMultByMatrix(MatrixBlock matrix, MatrixBlock result, int rl, int ru)
AColGroup
leftMultByMatrix
in class AColGroup
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 matrixpublic AColGroup scalarOperation(ScalarOperator op)
AColGroup
scalarOperation
in class AColGroup
op
- operation to performpublic AColGroup binaryRowOp(BinaryOperator op, double[] v, boolean sparseSafe, boolean left)
AColGroup
binaryRowOp
in class AColGroup
op
- The operation to executev
- The vector of values to apply, should be same length as dictionary length.sparseSafe
- True if the operation return 0 on all instances of values in v -- op(v[?], 0)left
- Specifies if the operation is executed on the left or right side of the values contained.public void unaryAggregateOperations(AggregateUnaryOperator op, double[] ret)
AColGroup
unaryAggregateOperations
in class AColGroup
op
- The operator usedret
- Rhe output matrix block.public void unaryAggregateOperations(AggregateUnaryOperator op, double[] result, int rl, int ru)
AColGroup
unaryAggregateOperations
in class AColGroup
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
AColGroup
readFields
in class AColGroup
in
- data inputIOException
- if IOException occurspublic void write(DataOutput out) throws IOException
AColGroup
write
in class AColGroup
out
- data outputIOException
- if IOException occurspublic long getExactSizeOnDisk()
AColGroup
getExactSizeOnDisk
in class AColGroup
public void countNonZerosPerRow(int[] rnnz, int rl, int ru)
AColGroup
countNonZerosPerRow
in class AColGroup
rnnz
- non-zeros per rowrl
- row lower bound, inclusiveru
- row upper bound, exclusivepublic MatrixBlock getValuesAsBlock()
AColGroup
getValuesAsBlock
in class AColGroup
public double[] getValues()
AColGroup
public boolean isLossy()
AColGroup
public double getMin()
AColGroup
public double getMax()
AColGroup
public void tsmm(double[] result, int numColumns)
AColGroup
public void tsmm(double[] result, int numColumns, int idxStart, int idxEnd)
AColGroup
tsmm
in class AColGroup
result
- A row major dense allocation of a matrixBlock, of size [numColumns x numColumns]numColumns
- The number of columns in the row major result matrix.idxStart
- The starting index in the _colIndexes.idxEnd
- The ending index in the _colIndexes.public AColGroup copy()
AColGroup
public boolean containsValue(double pattern)
AColGroup
containsValue
in class AColGroup
pattern
- The value to look for.public long getNumberNonZeros()
AColGroup
getNumberNonZeros
in class AColGroup
public int getNumRows()
AColGroup
getNumRows
in class AColGroup
public boolean isDense()
AColGroup
public void leftMultByAColGroup(AColGroup lhs, MatrixBlock result)
AColGroup
leftMultByAColGroup
in class AColGroup
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 intopublic AColGroup rightMultByMatrix(MatrixBlock right)
AColGroup
rightMultByMatrix
in class AColGroup
right
- The matrixBlock on the right of this matrix multiplicationpublic int getNumValues()
AColGroup
getNumValues
in class AColGroup
Copyright © 2021 The Apache Software Foundation. All rights reserved.